Class: Morpho::SessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
# File 'app/controllers/morpho/sessions_controller.rb', line 5

def create
  if (session_params[:email], session_params[:password], session_params[:remember_me])
    redirect_to root_path, success: I18n.t('morpho.messages.sessions.create.success') and return
  else
    flash.now[:error] = I18n.t('morpho.messages.sessions.create.failure')
    render :new
  end
end

#destroyObject



14
15
16
# File 'app/controllers/morpho/sessions_controller.rb', line 14

def destroy
  redirect_to , success: I18n.t('morpho.messages.sessions.destroy.success') and return if logout
end