Giljed Jowes
Giljed Jowes

Reputation: 729

How to route sign_up in Rails 3 using Devise

I am using Devise for authenticating a Rails application. I am now able to successfully route /users/sign_in and /users/sign_out to /sign_in and /sign_out via this code in routes.rb:

devise_for :user, :as => ''

How do I map /registration/sign_up to /sign_up?

So that sign_in, sign_out, and sign_up all have the same pattern.

Note that I am using Devise only for users. No admins.

Upvotes: 3

Views: 3534

Answers (1)

shingara
shingara

Reputation: 46914

You need to add the following block to your routes.rb file:

devise_scope :user do
  get "/sign_up" => "devise/registrations#new"
end

It's explained in: http://github.com/plataformatec/devise/wiki/How-To:-Change-the-default-sign_in-and-sign_out-routes

Upvotes: 6

Related Questions