Class: Adminpanel::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Adminpanel::SessionsController
- Defined in:
- app/controllers/adminpanel/sessions_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#get_menu_elements, #handle_unverified_request, #set_model, #signed_in_user
Methods included from RouterHelper
#adminpanel_resources, #default_controllers, #find_resources, #menu_items, #resources_path
Methods included from RestActionsHelper
Methods included from SessionsHelper
#current_user, #current_user=, #sign_in, #sign_out, #signed_in?
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/adminpanel/sessions_controller.rb', line 10 def create user = User.find_by_email(params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) sign_in user flash[:success] = t("authentication.signin success") redirect_to root_url else flash.now[:error] = t("authentication.signin error") render 'new' end end |
#destroy ⇒ Object
22 23 24 25 |
# File 'app/controllers/adminpanel/sessions_controller.rb', line 22 def destroy sign_out redirect_to signin_path end |
#new ⇒ Object
7 8 |
# File 'app/controllers/adminpanel/sessions_controller.rb', line 7 def new end |