Class: UserSessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  session[:simulate_id] = params[:user_id]
  target = session.delete :target
  redirect_to target || root_url
end

#destroyObject



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

def destroy
  session[:simulate_id] = nil
  redirect_to new_user_session_url, :notice => "Logout successful!"
end

#newObject



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

def new
  @users = User.all
end