Class: UserSessionsController
Instance Method Summary
collapse
#access_forbidden, #find_order, #initialize_extension_partials
included
#included
included
Instance Method Details
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/user_sessions_controller.rb', line 10
def create
@user_session = UserSession.new(params[:user_session])
success = @user_session.save
respond_to do |format|
format.html {
if success
flash[:notice] = t("logged_in_succesfully")
redirect_back_or_default products_path
else
flash.now[:error] = t("login_failed")
render :new
end
}
format.js {
render :js => success.to_json
}
end
end
|
29
30
31
32
33
|
# File 'app/controllers/user_sessions_controller.rb', line 29
def destroy
current_user_session.destroy
flash[:notice] = t("logged_out")
redirect_to products_path
end
|
#login_bar ⇒ Object
35
36
37
|
# File 'app/controllers/user_sessions_controller.rb', line 35
def login_bar
render :partial => "shared/login_bar"
end
|
6
7
8
|
# File 'app/controllers/user_sessions_controller.rb', line 6
def new
@user_session = UserSession.new
end
|