Routing to current_user path
ruby, ruby-on-rails, ruby-on-rails-3.2
Solution
try this,
<%= link_to 'Settings', edit_user_path(current_user) %>
Problem
So i have a Bootstrap nav bar on top. I would like to link_to current_user's edit path, but i always get the error: ``` ActionController::RoutingError at /blog No route matches {:action=>"edit", :controller=>"users"} ``` That's what im tryin at the moment: ``` <% if current_user %> <--! user logged in? --> <% @user ||= current_user %> <%= link_to 'Settings', edit_user_path %> <% end %> ``` I dont have this error at a /user/1/ page, but I have it everywhere else. Also tried this, but didn't help: ``` def edit if params[:id] @user = User.find(params[:id]) else @user = current_user end end ```