Class: Admin::ModeratorSessionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Admin::ModeratorSessionsController
- Defined in:
- app/controllers/admin/moderator_sessions_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/admin/moderator_sessions_controller.rb', line 10 def create @moderator_session = ModeratorSession.new(params[:moderator_session]) if @moderator_session.save flash[:notice] = "Login successful!" redirect_back_or_default admin_dashboard_url else flash.now[:error] = "Invalid credentials!" render :action => :new end end |
#destroy ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/admin/moderator_sessions_controller.rb', line 21 def destroy current_moderator_session.destroy flash[:notice] = "Logout successful!" redirect_back_or_default new_admin_moderator_session_url end |
#new ⇒ Object
6 7 8 |
# File 'app/controllers/admin/moderator_sessions_controller.rb', line 6 def new @moderator_session = ModeratorSession.new end |