Sha256: f2009d13e3bc78423aa2f2e634cfd097e8f2172947153b6d1463f4d361abb58f

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 Bytes

Contents

module Rich
  class CmsSessionsController < ::ApplicationController

    def login
      Rich::Cms::Auth.login
      if request.xhr?
        render :update do |page|
          if Rich::Cms::Auth.admin
            page.reload
          else
            page["##{Rich::Cms::Auth.klass_symbol}_#{Rich::Cms::Auth.inputs.first}"].focus
          end
        end
      else
        redirect_to request.referrer
      end
    end

    def logout
      Rich::Cms::Auth.logout
      if request.xhr?
        render :update do |page|
          page.reload
        end
      else
        redirect_to request.referrer
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rich_cms-3.0.2 app/controllers/rich/cms_sessions_controller.rb
rich_cms-3.0.1 app/controllers/rich/cms_sessions_controller.rb
rich_cms-3.0.0 app/controllers/rich/cms_sessions_controller.rb