Class: Eboshi::UserSessionsController

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

Instance Method Summary collapse

Methods included from ShallowRouteHelper

#assignment_path, #assignments_path, #convert_work_path, #edit_adjustment_path, #edit_invoice_path, #edit_work_path, #invoice_path, #invoices_path, #line_item_path, #merge_works_path, #new_adjustment_path, #new_assignment_path, #new_invoice_path, #new_payment_path, #payments_path, #work_path

Instance Method Details

#createObject



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

def create
  @user_session = UserSession.new(params[:user_session].to_h)
  if @user_session.save
    flash[:notice] = "Login successful!"
    redirect_to_last_client_or_back_or_default
  else
    render "new"
  end
end

#destroyObject



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

def destroy
  current_user_session.destroy
  redirect_to , notice: "Logout successful!"
end

#newObject



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

def new
  @user_session = UserSession.new
end