Sha256: 55d05d4c55e34e4f42559ee9fc31ad4687619c982929a750beac348c9818f464

Contents?: true

Size: 506 Bytes

Versions: 17

Compression:

Stored size: 506 Bytes

Contents

ActionView::Helpers::FormHelper.module_eval do

  def required_label(object_name, method, options = {})
    options = {:class => "required"}.merge!(options)

    label(object_name, method, "#{label_humanize_text(method, options)} *", options)
  end


  def label_humanize_text method, options = {}
    object = options[:object]

    content ||= if object && object.class.respond_to?(:human_attribute_name)
      object.class.human_attribute_name(method)
    end

    content ||= method.humanize
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
refinerycms-core-2.1.5 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.1.4 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.1.3 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.1.2 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.1.1 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.1.0 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.10 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.9 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.8 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.7 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.6 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.5 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.4 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.3 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.2 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.1 lib/refinery/ext/action_view/helpers/form_helper.rb
refinerycms-core-2.0.0 lib/refinery/ext/action_view/helpers/form_helper.rb