Module: AbstractInterface::ViewHelper

Defined in:
lib/abstract_interface/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#bObject Also known as: builder



3
4
5
# File 'lib/abstract_interface/view_helper.rb', line 3

def b
  @b ||= AbstractInterface::ViewBuilder.new self
end

#current_themeObject



21
22
23
# File 'lib/abstract_interface/view_helper.rb', line 21

def current_theme
  controller.current_theme
end

#themed_partial(partial) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/abstract_interface/view_helper.rb', line 12

def themed_partial partial
  themed_partial = "/#{THEMES_DIR}/#{current_theme.name}/#{partial}"
  if Crystal::Template.exist? themed_partial
    themed_partial
  else
    "/#{THEMES_DIR}/default/#{partial}"
  end
end

#themed_resource(resource) ⇒ Object



8
9
10
# File 'lib/abstract_interface/view_helper.rb', line 8

def themed_resource resource
  "/#{AbstractInterface.plugin_name.must_not_be.blank}/#{THEMES_DIR}/#{current_theme.name}/#{resource}"
end