Class: Eboshi::UserSessionsController
Instance Method Summary
collapse
#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
#create ⇒ Object
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
|
#destroy ⇒ Object
20
21
22
23
|
# File 'app/controllers/eboshi/user_sessions_controller.rb', line 20
def destroy
current_user_session.destroy
redirect_to login_path, notice: "Logout successful!"
end
|
#new ⇒ Object
6
7
8
|
# File 'app/controllers/eboshi/user_sessions_controller.rb', line 6
def new
@user_session = UserSession.new
end
|