Sha256: ef6e1b2467bca1c5533d09e8fabdabb0d806eaf9839f131cda658fff6ad20b7d

Contents?: true

Size: 400 Bytes

Versions: 7

Compression:

Stored size: 400 Bytes

Contents

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
  message = Array(instance.error_message).join(', ')

  if html_tag =~ /class="checkbox"/ || ((html_tag !~ /type="checkbox"/) && (html_tag !~ /label/))
    %(<div class="has-error">#{html_tag}<span class="help-block">✖ #{message}</span></div>).html_safe
  else
    %(<div class="has-error">#{html_tag}</div>).html_safe
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sal-engine-0.2.0 config/initializers/error_span.rb
sal-engine-0.1.0 config/initializers/error_span.rb
sal-engine-0.0.6 config/initializers/error_span.rb
sal-engine-0.0.5 config/initializers/error_span.rb
sal-engine-0.0.4 config/initializers/error_span.rb
sal-engine-0.0.3 config/initializers/error_span.rb
sal-engine-0.0.2 config/initializers/error_span.rb