Class: AbstractController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/theme_support/patches/abstractcontroller_ex.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#current_theme(passed_theme = nil) ⇒ Object

Retrieves the current set theme



24
25
26
# File 'lib/theme_support/patches/abstractcontroller_ex.rb', line 24

def current_theme
  @current_theme
end

#force_liquid_templateObject

Returns the value of attribute force_liquid_template.



3
4
5
# File 'lib/theme_support/patches/abstractcontroller_ex.rb', line 3

def force_liquid_template
  @force_liquid_template
end

Class Method Details

.theme(theme_name, conditions = {}) ⇒ Object

Use this in your controller just like the layout macro. Example:

theme 'theme_name'

-or-

theme :get_theme

def get_theme
  'theme_name'
end


18
19
20
21
# File 'lib/theme_support/patches/abstractcontroller_ex.rb', line 18

def self.theme(theme_name, conditions = {})
  # TODO: Allow conditions... (?)
  write_inheritable_attribute "theme", theme_name
end