Sha256: 0a6391475872607057522f33e44d249ac20c983f6f95d9dc4ca70bd81e44c49e

Contents?: true

Size: 782 Bytes

Versions: 37

Compression:

Stored size: 782 Bytes

Contents

#
# Allow some application_helper methods to be used in the scoped form_for manner
#
class ActionView::Helpers::FormBuilder
  def field_container(method, options = {}, &block)
    @template.field_container(@object_name, method, options, &block)
  end

  def error_message_on(method, options = {})
    @template.error_message_on(@object_name, method, objectify_options(options))
  end

  def field_hint(method, options = {})
    title = options[:title] || @object.class.human_attribute_name(method)
    text = options[:text] || I18n.t(method, scope: [:spree, :hints, @object.class.model_name.i18n_key])
    @template.admin_hint(title, text)
  end
end

ActionView::Base.field_error_proc = proc{ |html_tag, _instance| "<span class=\"field_with_errors\">#{html_tag}</span>".html_safe }

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
solidus_backend-2.5.2 config/initializers/form_builder.rb
solidus_backend-2.5.1 config/initializers/form_builder.rb
solidus_backend-2.5.0 config/initializers/form_builder.rb
solidus_backend-2.5.0.rc1 config/initializers/form_builder.rb
solidus_backend-2.5.0.beta2 config/initializers/form_builder.rb
solidus_backend-2.5.0.beta1 config/initializers/form_builder.rb
solidus_backend-2.4.2 config/initializers/form_builder.rb
solidus_backend-2.4.1 config/initializers/form_builder.rb
solidus_backend-2.3.1 config/initializers/form_builder.rb
solidus_backend-2.2.2 config/initializers/form_builder.rb
solidus_backend-2.1.1 config/initializers/form_builder.rb
solidus_backend-2.0.3 config/initializers/form_builder.rb
solidus_backend-1.4.2 config/initializers/form_builder.rb
solidus_backend-2.4.0 config/initializers/form_builder.rb
solidus_backend-2.4.0.rc1 config/initializers/form_builder.rb
solidus_backend-2.4.0.beta1 config/initializers/form_builder.rb
solidus_backend-2.3.0 config/initializers/form_builder.rb
solidus_backend-2.3.0.rc3 config/initializers/form_builder.rb
solidus_backend-2.3.0.rc2 config/initializers/form_builder.rb
solidus_backend-2.3.0.rc1 config/initializers/form_builder.rb