Rails noob here. I am using carrierwave in a rails 3 app so users can upload a profile picture. I set up a separate model, controller and views (profile_pictures) to handle this. To avoid making errors i use scaffold as a starting point.
route file:
resources :profile_pictures
rake routes:
edit_profile_picture GET /profile_pictures/:id/edit(.:format) {:action=>"edit", :controller=>"profile_pictures"}
link to edit.html.erb:
<%= link_to "profile picture", edit_profile_picture_path %>
error:
No route matches {:action=>"edit", :controller=>"profile_pictures"}
Side Note: I am constantly running into problems with routes… its driving me nuts. I’ve found numerous pages regarding conversion of prior routing format to rails 3 routes. Is there a basic tutorial on routes that explains all the nubbies? … preferably in rails 3 format but a prior version is ok if that is all there is.
Thanks!!
Try
<%= link_to "profile picture", edit_profile_picture_path(@picture) %>Becouse you have a route
/profile_pictures/:id/edit, @picture == :id