Class: Rich::CmsSessionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/rich/cms_sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#loginObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/rich/cms_sessions_controller.rb', line 4

def 
  Rich::Cms::Auth.
  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

#logoutObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/rich/cms_sessions_controller.rb', line 19

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