Class: Munificent::Admin::UserSessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/munificent/admin/user_sessions_controller.rb', line 13

def create
  @user_session = UserSession.new(user_session_params.to_h)

  if @user_session.save
    redirect_to root_path
  else
    flash[:alert] = @user_session.errors.full_messages.join(", ")
    redirect_to new_user_session_path
  end
end

#destroyObject



24
25
26
27
28
# File 'app/controllers/munificent/admin/user_sessions_controller.rb', line 24

def destroy
  current_user_session.destroy

  redirect_to new_user_session_path
end

#newObject



9
10
11
# File 'app/controllers/munificent/admin/user_sessions_controller.rb', line 9

def new
  @user_session = UserSession.new
end