when i follow the Devise Wiki at https://github.com/plataformatec/devise/wiki/How-To:-Change-the-default-sign_in-and-sign_out-routes , my default route names do not change at all, here is my code :
MyApp::Application.routes.draw do
root :to => "profile#index"
devise_for :users
namespace :user do
root :to => "profile#index"
end
as :user do
get "/login" => "devise/sessions#new"
get "/signup" => "devise/registrations#new"
end
The two route changes didnt work so i stopped.
How do i change it so my routes are:
/users/sign_in = /login
/users/sign_up = /signup
/users/sign_out = /signout
/users/edit = /edit
I am using Devise 1.3.4 and Rails 3.0.7.
Thank you in advance!
Best Answer
OK i figured it out, ill just type this out to help other newbies!
The routes themselves change but not the navigation links unless coded that way. try http://localhost:3000/login and http://localhost:3000/users/sign_up, they are the same thing but just have to be typed in manually.
My new code looks like this ( navigation links & route configurations together):
routes.rb:
the views/devise/menu/_login_items.html.erb :
the views/devise/menu/_registration_items.html.erb
I certainly hope this helps people who were lost like me and just got into both devise and RoR. it will give you a good understanding on how to get the routes to look the way you want it to be in a simple manner, yet still work. Good luck!