Class: Clearance::SessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/clearance/sessions_controller.rb', line 11

def create
  @user = authenticate(params)
  if @user.nil?
    flash_failure_after_create
    render :template => 'sessions/new', :status => :unauthorized
  else
    (@user)
    redirect_back_or(url_after_create)
  end
end

#destroyObject



22
23
24
25
# File 'app/controllers/clearance/sessions_controller.rb', line 22

def destroy
  sign_out
  redirect_to(url_after_destroy)
end

#newObject



7
8
9
# File 'app/controllers/clearance/sessions_controller.rb', line 7

def new
  render :template => 'sessions/new'
end