Module: Machined::Helpers::AssetTagHelpers

Included in:
Context
Defined in:
lib/machined/helpers/asset_tag_helpers.rb

Instance Method Summary collapse

Instance Method Details

#asset_path(source, options = {}) ⇒ Object

Override asset_path to also work with the Padrino::Helpers::AssetTagHelpers API.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/machined/helpers/asset_tag_helpers.rb', line 6

def asset_path(source, options = {})
  case source
  when :css
    path_to_asset options, :dir => 'stylesheets', :ext => 'css'
  when :images
    path_to_asset options, :dir => 'images'
  when :js
    path_to_asset options, :dir => 'javascripts', :ext => 'js'
  else
    path_to_asset source, options
  end
end

#image_path(source, options = {}) ⇒ Object

Redefine image_path to work with Sprockets::Helpers.



20
21
22
# File 'lib/machined/helpers/asset_tag_helpers.rb', line 20

def image_path(source, options = {})
  asset_path source, { :dir => 'images' }.merge(options)
end