Module: Rcms::ApplicationController::InstanceMethods

Defined in:
lib/rcms/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#apply_meta_tags(object) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rcms/application_controller.rb', line 22

def apply_meta_tags object
  meta_tags = object.respond_to?(:meta_tags) ? object.meta_tags : object

  if meta_tags.is_a?(Hash)
    set_meta_tags meta_tags
  else
    if meta_tags.respond_to?(:each)
      meta_tags.each do |mt|
        set_meta_tags mt.key => mt.value if mt.value.present?
      end
    end
  end
end

#rcms_menu(key, options) ⇒ Object



14
15
16
# File 'lib/rcms/application_controller.rb', line 14

def rcms_menu key, options
  @rcms_menu = "#{options[:scope]}#{key}"
end

#rcms_menu_class(key, options) ⇒ Object



18
19
20
# File 'lib/rcms/application_controller.rb', line 18

def rcms_menu_class key, options
  @rcms_menu == "#{options[:scope]}#{key}" ? 'active' : ''
end

#render(*args) ⇒ Object



36
37
38
39
40
# File 'lib/rcms/application_controller.rb', line 36

def render *args
  run_callbacks :render do
    super
  end
end