Class: UserSessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/user_sessions_controller.rb', line 7

def create
  @user_session = UserSession.new
  if @user_session.save
    flash[:notice] = 'Logged in successfully'
    redirect_back_or_default root_path
  else
    render :action => 'new'
  end
end

#destroyObject



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

def destroy
  current_user_session.destroy
  flash[:notice] = 'Logged out successfully'
  redirect_to root_path
end

#newObject



3
4
5
# File 'app/controllers/user_sessions_controller.rb', line 3

def new
  @user_session = UserSession.new
end