Sha256: a3eefbf4716f175efabe4ced369a7ed78f522e55d57601dc35e68489868efe31

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

module ComfortableMexicanSofa::ViewMethods
  # Wrapper around CmsFormBuilder
  def cms_form_for(record_or_name_or_array, *args, &proc)
    options = args.extract_options!
    form_for(record_or_name_or_array, *(args << options.merge(:builder => ComfortableMexicanSofa::FormBuilder)), &proc)
  end
  
  # Wrapper for <span>
  def span_tag(*args)
    content_tag(:span, *args)
  end
  
  # Rails 3.0 doesn't have this helper defined
  def datetime_field_tag(name, value = nil, options = {})
    text_field_tag(name, value, options.stringify_keys.update('type' => 'datetime'))
  end
end

ActionView::Base.send :include, ComfortableMexicanSofa::ViewMethods

ActionView::Helpers::AssetTagHelper.register_javascript_expansion :cms => [
  'comfortable_mexican_sofa/jquery',
  'comfortable_mexican_sofa/jquery-ui',
  'comfortable_mexican_sofa/rails',
  'comfortable_mexican_sofa/cms',
  'comfortable_mexican_sofa/plupload/plupload.full.min',
  'comfortable_mexican_sofa/uploader'
]
ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :cms => [
  'comfortable_mexican_sofa/reset',
  'comfortable_mexican_sofa/structure',
  'comfortable_mexican_sofa/typography'
]

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.0.5 lib/comfortable_mexican_sofa/view_methods.rb
comfortable_mexican_sofa-1.0.4 lib/comfortable_mexican_sofa/view_methods.rb
comfortable_mexican_sofa-1.0.3 lib/comfortable_mexican_sofa/view_methods.rb
comfortable_mexican_sofa-1.0.2 lib/comfortable_mexican_sofa/view_methods.rb