Royal Summers


110 Experience
0 Lessons Completed
0 Questions Solved


Posted in How do I update?

I just tried it again and got the following message:

Started POST "/authors/posts" for at 2018-05-15 07:34:57 -0700
Processing by Authors::PostsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"07t0mQxSuviikB9QfFsDLpGAAq13aARnnE7CFNH8L8QgYDJOPX0oSzQl39u8NgkIhorDrexoYfn/93rq1iQJ1Q==", "post"=>{"title"=>"Royal Post 2", "banner_image_url"=>"", "body"=>"test", "description"=>"test"}, "commit"=>"Create Post"}
   (0.0ms)  begin transaction
  Post Exists (15.0ms)  SELECT  1 AS one FROM "posts" WHERE ("posts"."id" IS NOT NULL) AND "posts"."slug" = ? LIMIT ?  [["slug", "royal-post-2"], ["LIMIT", 1]]
   (0.0ms)  rollback transaction
  Rendering authors/posts/new.html.erb within layouts/author
  Rendered authors/posts/_form.html.erb (6.0ms)
  Rendered authors/posts/new.html.erb within layouts/author (104.0ms)
  Rendered layouts/_navbar.html.erb (2.0ms)
Completed 200 OK in 1337ms (Views: 771.7ms | ActiveRecord: 15.0ms)

Appears that the post already exists?  I recently added Devise and before got the message that I can't post unless the author exists but the author exists and I am signed-in?  Any suggestions?

Posted in How do I update?

So, I'm following a YouTube  video trying to create my first Blog.  See the following link, at minute  13:50,  I'm attempting to do an update with appears to be a form helper.  Here's my line of code: <%= form_for(post, url: url, local: true) do |form| %>  Can anyone tell me why might the Update isn't working?

Posted in How do I fix a route -- trying to do an Edit/Update

I'm getting the following error when editing and then updating a blog post:

From Chrome Browser
"No route matches [PATCH] "/authors/posts"

From Rails Server (command line)
ActionController::RoutingError (No route matches [PATCH] "/authors/posts"):

Here's the file (app/views/authors/posts/edit.html.erb)

<% provide(:page_title, "Edit #{@post.title}") %>
<% provide(:author, 'active') %>

Editing Post

<%= render 'form', post: @post, url: authors_post_url(@post) %>

<%= link_to 'Show', @post %> |
<%= link_to 'Back', authors_post_path %>

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.