Sha256: c8ff4a604ace99a0cd98eef01efde16bef6808025bd0a854ffd92cca5ec8e63e

Contents?: true

Size: 736 Bytes

Versions: 4

Compression:

Stored size: 736 Bytes

Contents

module Machined
  module Helpers
    module AssetTagHelpers
      # Override asset_path to also work with the
      # Padrino::Helpers::AssetTagHelpers API.
      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

      # Redefine image_path to work with Sprockets::Helpers.
      def image_path(source, options = {})
        asset_path source, { :dir => 'images' }.merge(options)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
machined-1.1.0 lib/machined/helpers/asset_tag_helpers.rb
machined-1.0.3 lib/machined/helpers/asset_tag_helpers.rb
machined-1.0.2 lib/machined/helpers/asset_tag_helpers.rb
machined-1.0.1 lib/machined/helpers/asset_tag_helpers.rb