Class: UserSessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/user_sessions_controller.rb', line 9

def create
  @user_session = UserSession.new(params[:user_session])
  if @user_session.save
    flash[Rails.application.config.constellation.authentication.success_flash] = t("constellation.authentication.user_sessions.create.success_flash")
    redirect_back_or_default self.respond_to?(:signin_redirection) ?  : Rails.application.config.constellation.authentication.
  else
    render :action => :new
  end
end

#destroyObject



19
20
21
22
23
# File 'app/controllers/user_sessions_controller.rb', line 19

def destroy
  current_user_session.destroy    
  flash[Rails.application.config.constellation.authentication.success_flash] = t("constellation.authentication.user_sessions.destroy.success_flash")
  redirect_to self.respond_to?(:signout_redirection) ? signout_redirection : Rails.application.config.constellation.authentication.signout_redirection
end

#newObject



5
6
7
# File 'app/controllers/user_sessions_controller.rb', line 5

def new
  @user_session = UserSession.new
end