Module: Locomotive::Concerns::WithinSiteController::ClassMethods

Defined in:
app/controllers/locomotive/concerns/within_site_controller.rb

Instance Method Summary collapse

Instance Method Details

#within_site(required = true, guest = false) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'app/controllers/locomotive/concerns/within_site_controller.rb', line 44

def within_site(required = true, guest = false)
  class_eval do
    before_action :require_site if required

    unless guest
      before_action :validate_site_membership, if: :current_site?
    end

    around_action :set_timezone, if: :current_site?

    before_action :set_current_content_locale, if: :current_site?
  end
end

#within_site_but_as_guestObject



40
41
42
# File 'app/controllers/locomotive/concerns/within_site_controller.rb', line 40

def within_site_but_as_guest
  within_site(true, true)
end

#within_site_only_if_existing(guest = false) ⇒ Object



36
37
38
# File 'app/controllers/locomotive/concerns/within_site_controller.rb', line 36

def within_site_only_if_existing(guest = false)
  within_site(false, guest)
end