Module: Ramaze::Helper::Asset::ClassMethods

Defined in:
lib/zen/helper/asset.rb

Overview

Module of which the methods will become available as class methods to the class that included Ramaze::Helper::Asset.

Since:

Instance Method Summary (collapse)

Instance Method Details

- (Object) load_asset_group(name, methods = nil)

Loads an asset group. This method can either load a single asset group or an array of groups.

Examples:

load_asset_group(:datepicker)
load_asset_group([:editor, :datepicker])

Parameters:

  • methods (Array) (defaults to: nil)

    An array of methods to load the assets for.

See Also:

  • Asset::Environment#load_asset_group()

Since:

  • 0.3



51
52
53
54
55
56
57
58
59
# File 'lib/zen/helper/asset.rb', line 51

def load_asset_group(name, methods = nil)
  if name.respond_to?(:each)
    name.each do |n|
      Zen.asset.load_asset_group(n, self, methods)
    end
  else
    Zen.asset.load_asset_group(name, self, methods)
  end
end

- (Object) serve(type, files, options = {})

Provides a shortcut method to Zen.asset.serve() and automatically loads all the given assets for the calling class.

See Also:

  • Asset::Environment#serve()

Since:

  • 0.3



35
36
37
# File 'lib/zen/helper/asset.rb', line 35

def serve(type, files, options = {})
  Zen.asset.serve(type, files, options.merge({:controller => self}))
end