Sha256: b545b144daf557c9075cf713285c142e40a4911d040d2427b4c139385a1a2cc3

Contents?: true

Size: 1.65 KB

Versions: 9

Compression:

Stored size: 1.65 KB

Contents

module Formize
  module Helpers
    module AssetTagHelper

      # Include all stylesheets, javascripts and locales.
      # For Rails 3.0 only, not needed since Rails 3.1.
      #
      # @example Classic use
      #   <%= formize_include_tag -%>
      #
      # @example Classic use with a specified locale
      #   <%= formize_include_tag :locale=>:jp -%>
      #
      # @option options [Symbol, String] :locale
      #   Select locale file to use for jQuery UI datepickers. The locale must be 
      #   specified using 2 or 5 characters, like `:en` or `"en-GB"`.
      #   By default, `I18n.locale` is used to determine the current locale.
      #
      # @option options [TrueClass, FalseClass] :skip_stylesheet
      #   Skip the inclusion of default stylesheet: formize.css
      # 
      # @option options [TrueClass, FalseClass] :monolithic
      #   If +true+ includes a monolithic javascript formize.js else include
      #   choosen specific javascripts with little weight.
      # 
      # @deprecated Will be removed when rails <= 3.0 support won't be effective in 
      #   versions >= 0.1.0
      def formize_include_tag(options={})
        options[:locale] ||= ::I18n.locale
        html  = ""
        if options[:monolithic]
          html << javascript_include_tag('formize')
        else
          html << javascript_include_tag('locales/jquery.ui.datepicker-' + locale.to_s)
          html << javascript_include_tag('jquery.ui.formize')
        end
        unless options[:skip_stylesheet]
          html << stylesheet_link_tag('jquery-ui')
          html << stylesheet_link_tag('formize') 
        end
        return html.html_safe
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
formize-0.0.27 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.26 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.25 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.24 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.23 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.22 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.21 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.20 lib/formize/helpers/asset_tag_helper.rb
formize-0.0.19 lib/formize/helpers/asset_tag_helper.rb