Class: SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


2
3
4
5
6
# File 'app/controllers/sessions_controller.rb', line 2

def create
  action = Action::User::Signin.new(request)
  self.current_user = action.user
  redirect_to action.new_user? ? welcome_url : user_url(current_user)
end

#destroyObject


8
9
10
11
# File 'app/controllers/sessions_controller.rb', line 8

def destroy
  session[:user_id] = nil
  redirect_to root_url, :notice => "Signed out!"
end