views:

1699

answers:

3

I'm currently trying to use Devise 1.1.pre3 as authentication in my upcoming project, but I can't get it to work properly.

I have done everything it says in the documentation, installed warden and the correct Devise version, run the install and used the generator to create the model. But when I try to access the sign up form (localhost:3000/users/sign_up) all I get is

No route matches "/users/sign_up"

But when I run rake routing I get the following:

...
GET  /users/sign_up(.:format) {:controller=>"devise/registrations", :action=>"new"}
...

I doesn't have any files matching that controller.

Is there any steps I have missed (installed, updated routing etc and created model)

+2  A: 

I think the default sign_in path would be /users/sign_in.

You can override this in the route by passing it :path_names => {:sign_in => "login", :sign_out => "logout"}

Then you would login with /users/login, and logout with /users/logout.

Shane
A: 

Is there a way to skip the users prefix from the path. I like just /login, /logout, and /signup. I tried to leave devise_for :users, :as => "" -- blank but this doesn't work for me. I get abstract controller nomethoderror.

Steve
A: 

you should scope the relevant model in the routes.. eg..

devise_scope :user do
  get "register"  => "devise/registrations#new" 
  get "login"  => "devise/sessions#new"    
  get "logout" => "devise/sessions#destroy"
end 
Dom