Class: InvoiceBar::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- InvoiceBar::SessionsController
- Defined in:
- app/controllers/invoice_bar/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Log the user in.
-
#destroy ⇒ Object
Log out.
- #login_from_http_basic ⇒ Object
-
#new ⇒ Object
Log in form.
Instance Method Details
#create ⇒ Object
Log the user in
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/invoice_bar/sessions_controller.rb', line 13 def create user = login(params[:email], params[:password], params[:remember_me]) if user redirect_back_or_to root_url else flash[:error] = t('messages.cannot_log_in') redirect_back_or_to root_url end end |
#destroy ⇒ Object
Log out
26 27 28 29 30 |
# File 'app/controllers/invoice_bar/sessions_controller.rb', line 26 def destroy logout redirect_to root_url, notice: t('messages.logged_out') end |
#login_from_http_basic ⇒ Object
32 33 34 |
# File 'app/controllers/invoice_bar/sessions_controller.rb', line 32 def login_from_http_basic redirect_to root_path end |
#new ⇒ Object
Log in form
8 9 10 |
# File 'app/controllers/invoice_bar/sessions_controller.rb', line 8 def new respond_on_new @session end |