How to route sign_up in Rails 3 using Devise

I am using Devise to authenticate a Rails application. Now I can successfully route / users / sign _in and / users / sign_out to / sign _in and / sign_out through this code in routes.rb:

devise_for :user, :as => ''

How do I display / register / sign_up in / sign _up?

Thus, sign_in, sign_out and sign_up have the same pattern.

Please note that I use Devise for users only. No admins.

+3
source share
1 answer

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

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

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

+6

Source: https://habr.com/ru/post/1769935/


All Articles