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
  @current_theme ||= AbstractInterface::Theme.new
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/#{current_theme.name}/#{partial}"
  if Template.exist? themed_partial
    themed_partial
  else
    "/themes/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/#{current_theme.name}/#{resource}"
end