I created a scaffold for 'messages', and new_message_path and edit_message_path (for use in link_to's) are all set up, but now I've created app/views/messages/sent.html.erb, and I want to do something along the lines of <%= link_to 'Sent', sent_message_path %>, but I can't figure out how to do that. I get
undefined local variable or method `sent_message_path' for #<ActionView::Base:0x103117c50>
Those methods are created automatically when routes are defined and in the case of RESTful routes, they follow a predictable convention.
Running 'rake routes' is a helpful way of seeing all of the routes being generated.
I recommend you read: http://guides.rubyonrails.org/routing.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With