Class: Rich::CmsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Rich::CmsController
- Defined in:
- app/controllers/rich/cms_controller.rb
Instance Method Summary collapse
- #after_rich_cms_login(authenticated, key) ⇒ Object
- #after_rich_cms_logout ⇒ Object
- #display ⇒ Object
- #login ⇒ Object
- #logout ⇒ Object
- #position ⇒ Object
- #update ⇒ Object
Instance Method Details
#after_rich_cms_login(authenticated, key) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/rich/cms_controller.rb', line 38 def after_rich_cms_login(authenticated, key) if request.xhr? render :update do |page| if authenticated page.reload else page["##{key}_#{rich_cms_authentication_inputs.first}"].focus end end else redirect_to request.referrer end end |
#after_rich_cms_logout ⇒ Object
54 55 56 |
# File 'app/controllers/rich/cms_controller.rb', line 54 def after_rich_cms_logout redirect_to request.referrer end |
#display ⇒ Object
7 8 9 10 |
# File 'app/controllers/rich/cms_controller.rb', line 7 def display (session[:rich_cms] ||= {})[:display] = params[:display] request.xhr? ? render(:nothing => true) : redirect_to(request.referrer) end |
#login ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/rich/cms_controller.rb', line 17 def login case rich_cms_auth.logic when :authlogic @current_rich_cms_admin_session = rich_cms_authenticated_class.new params[key = rich_cms_authenticated_class.name.underscore.gsub("/", "_")] authenticated = @current_rich_cms_admin_session.save after_rich_cms_login authenticated, key end end |
#logout ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/rich/cms_controller.rb', line 27 def logout case rich_cms_auth.logic when :authlogic (@current_rich_cms_admin_session ||= rich_cms_authenticated_class.find).destroy end session[:rich_cms] = nil after_rich_cms_logout end |
#position ⇒ Object
12 13 14 15 |
# File 'app/controllers/rich/cms_controller.rb', line 12 def position session[:rich_cms][:position] = params[:position] render :nothing => true end |