Rails route problem -


class userscontroller < applicationcontroller    def edit     ...   end 

mu routes.rb

match '/user/:id/profile/edit', :to => 'users#edit', :as => "user_profile_edit", :via => "get" 

my link:

<%= link_to image_tag("icons/run.png"), user_profile_edit_path %> 

exception:

no route matches {:controller=>"users", :action=>"edit"} 

what i'm doing wrong? thanks.

you need supply user record. assuming record assigned @user

<%= link_to image_tag("icons/run.png"), user_profile_edit_path(@user) %> 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -