Rails 4 + Devise: Invalid Route Name, Already in Use

Rails 4 + Devise: Invalid route name, already in use

You have two routes devise_for :users in your routes.rb - remove the first one.

Invalid route name, already in use: 'user'

Since you are using devise there are some routes already created by devise_for users so avoid using such routes which has conflict with already defined routes. Instead of using as: :user put another relevant name like as::user_profile

Hope it helps

Rails 4: Invalid route name, already in use (ArgumentError)

Do the following instead of above:

resource :contact, only: [:new, :create]

OR

get 'contact' => 'contact#new'
post 'contact' => 'contact#create', :as => 'contact'

Invalid route name, already in use: 'admin_root' (ArgumentError) - Failed ActiveAdmin install

Solved it by uninstalling ActiveAdmin, reinstalling it, deleting the second ActiveAdmin.routes(self) in my routes file, then deleting my schema file. After that, I ran rake db:reset and remigrated the database.



Related Topics



Leave a reply



Submit