Class: AccountController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AccountController
- Defined in:
- app/controllers/account_controller.rb
Instance Method Summary collapse
- #login ⇒ Object
- #login_post ⇒ Object
- #logout ⇒ Object
- #page_title ⇒ Object
- #signup ⇒ Object
- #signup_post ⇒ Object
Methods included from ApplicationHelper
Instance Method Details
#login ⇒ Object
18 19 |
# File 'app/controllers/account_controller.rb', line 18 def login end |
#login_post ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/account_controller.rb', line 8 def login_post if authenticate(params[:login], params[:password]) flash[:notice] = "Logged in successfully" redirect_back_or_default(home_page()) else flash[:notice] = "Login failed." redirect_to(:action => :login) end end |
#logout ⇒ Object
32 33 34 35 36 |
# File 'app/controllers/account_controller.rb', line 32 def logout user_logout() flash[:notice] = "You have been logged out." redirect_back_or_default(home_page()) end |
#page_title ⇒ Object
38 39 40 |
# File 'app/controllers/account_controller.rb', line 38 def page_title 'Welcome !' end |
#signup ⇒ Object
29 30 |
# File 'app/controllers/account_controller.rb', line 29 def signup end |
#signup_post ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/controllers/account_controller.rb', line 21 def signup_post user_signup!(params[:user]) redirect_back_or_default(home_page()) flash[:notice] = "Thanks for signing up!" rescue ActiveRecord::RecordInvalid redirect_to(:action => :signup) end |