link_to nested resources

11 views
Skip to first unread message

fugee ohu

unread,
Dec 30, 2015, 3:54:37 PM12/30/15
to Ruby on Rails: Talk
users has_one profile
profile has_many schools
i'm trying to build a link to this route      edit_user_profile_school GET    /users/:user_id/profile/schools/:id/edit(.:format)                  schools#edit
i've been trying stuff like
-------------------------------------------------------------------------------------
 @schools.each do |school|
link_to 'Edit', edit_user_profile_school(current_user, school)
-------------------------------------------------------------------------------------
but nothing seems to work, can you please help me with this syntax ~ thanks
Reply all
Reply to author
Forward
0 new messages