Инициалиазация репозитория
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance_tag|
|
||||
fragment = Nokogiri::HTML.fragment(html_tag)
|
||||
field = fragment.at('input,select,textarea')
|
||||
|
||||
html = if field
|
||||
error_message = instance_tag.error_message.join(', ')
|
||||
field['class'] = "#{field['class']}"
|
||||
html = <<-HTML
|
||||
<div class="field_with_errors">
|
||||
#{fragment.to_s}
|
||||
<p class="error-message">#{error_message.upcase_first}</p>
|
||||
</div>
|
||||
HTML
|
||||
html
|
||||
else
|
||||
html_tag
|
||||
end
|
||||
|
||||
html.html_safe
|
||||
end
|
||||
Reference in New Issue
Block a user