Class: UserSessionsController
Instance Attribute Summary
#formats
Instance Method Summary
collapse
included
clear_respond_to, inherit_resources, respond_to, #respond_to, #respond_with, #responder
Instance Method Details
#create ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/app/controllers/user_sessions_controller.rb', line 9
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
flash[:notice] = "Login successful!"
redirect_back_or_default my_account_url
else
flash[:notice] = "Invalid login/password."
render :action => :new
end
end
|
#destroy ⇒ Object
20
21
22
23
24
|
# File 'lib/app/controllers/user_sessions_controller.rb', line 20
def destroy
current_user_session.destroy
flash[:notice] = "Logout successful!"
redirect_back_or_default login_path
end
|
#new ⇒ Object
5
6
7
|
# File 'lib/app/controllers/user_sessions_controller.rb', line 5
def new
@user_session = UserSession.new
end
|