railstutorial/sample_app

Having issues when i try to view micropost

Closed this issue · 3 comments

Esom commented

undefined method `micropost_path' for #<#Class:0x47a4830:0x47ae7c0>
Extracted source (around line #11):

8:
9: <% if current_user?(micropost.user) %>
10:
11: <%= link_to 'delete', micropost , :method => :delete,
12: :confirm => "You sure?",
13: :title => micropost.content
14: %>

That section of the book has been heavily debugged. Take a look at the reference implementation of the sample app to track down the discrepancy.

Esom commented

thanks

A bit late, but if anyone happens to see this, I had this same error and it was caused by me mistakenly using the line:
"resource :microposts, only: [:create, :destroy]"

instead of the line:
"resources :microposts, only: [:create, :destroy]"

in routes.rb.