Ask A Question

Notifications

You’re not receiving notifications from this thread.

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

Royal Summers asked in Rails

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 %>

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,603+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.