Class: UsersController

Inherits:
ApplicationController show all
Defined in:
lib/rails/generators/simple_login/templates/controllers/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
# File 'lib/rails/generators/simple_login/templates/controllers/users_controller.rb', line 7

def create
  @user = User.new(params[:user])
  if @user.save
    cookies[:auth_token] = @user.auth_token
    redirect_to root_url
  else
    render "new"
  end
end

#newObject



3
4
5
# File 'lib/rails/generators/simple_login/templates/controllers/users_controller.rb', line 3

def new
  @user = User.new
end