Warning! Before using this section you need to install the 'currentuser-services' gem. Check the process on the Resources page.

You can use the currentuser_sign_up_url helper in your actions and views to allow a visitor to reach a sign-up form.

In a view:

<% # views/shared/_menu.html.erb %>
<%= link_to 'Sign up', currentuser_sign_up_url %>

Or in a controller action:

# controllers/main_controller.rb
class MainController < ApplicationController
  def sign_up
    redirect_to currentuser_sign_up_url
  end
end

After signing up, the visitor is automatically authenticated in your application (see Authentication page).

Tip! Using the sign up URL is not mandatory. Provided you protect at least one of your actions with before_action :require_currentuser (see Authentication page), a visitor reaching this action will be redirected to the sign-in form, which has a link to the sign-up form.