plataformatec/devise — Issue #1412: Devise RoutingError
Author: regdog
Created: 2011-11-03 03:18:32+00:00
State: open

I have a navigation menu partial template in /shared folder, which includes a link to edit user profile. When the user profile link is clicked, it renders error as below:

ActionController::RoutingError in Users/registrations#edit
No route matches {:controller=>"users/projects", :actoin=>:index}

here is the route

# route for user profile edit
devise_for :users, :controllers => {::registrations => 'users/registrations'} do
get 'profile', :to => "users/registrations#edit", :as=>'profile'
end

# route projects, plans, challengs
resources projects, plans, challenges

here is the navigation menu

# /shared/_navigation.html.erb

<%= link_to "Projects", projects_path %>

<%= link_to "All Projects",projects_path, :id => current_page?(:controller=>'projects', :action=>'index') ? "active" : "" %>
<%= link_to "Plans", plans_path, :id => current_page?(:controller=>'plans') ? "active" : "" %>
<%= link_to "Challenges", challenges_path, :id => current_page?(:controller=>'challenges') ? "active" : "" %>

<%= link_to "My Profile", profile_path %>

<%= link_to "Edit account", profile_path, :id => current_page?(:controller=>'users/registrations', :action=>'edit') ? "active" : "" %>
<%= link_to "Sign Out", destroy_user_session_path, :method => 'delete' %>