Closed dedles closed 9 years ago
hit @dedles, i guess this causes by rails "field-with-errors" wrapper. Check this out..
This issue still exists. It would be awesome if the gem included a wrapper override.
I also used an override in my application.rb like this:
config.action_view.field_error_proc = Proc.new { |html_tag, instance| html_tag }
To switch it off, but it would be awesome to have it red underlined, and a bit quicker to redraw.
@ICT22 +1, Yes, turning wrappers off is not really a solution.
A somewhat better workaround based on this stack post:
# config/initializers/field_with_errors_override.rb
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
class_attr_index = html_tag.index 'class="'
if class_attr_index
html_tag.insert class_attr_index+7, 'invalid '
else
html_tag.insert html_tag.index('>'), ' class="invalid"'
end
end
After submitting a form with some incorrect input the labels and text becomes static and will not move to the top as they do when the field is selected or when the page loads. see:
My form code looks like this:
I've tried disabling turbolinks and using the jquery.turbolinks gem. But neither approach has worked. Any advise would be really appreciated