Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Environment.rb
- Rails::Initializer.run do |config|
- # ... code here ...
- ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
- if html_tag =~ /<(input|label|textarea|select)/
- error_class = 'error'
- nodes = Hpricot(html_tag)
- nodes.each_child { |node| node[:class] = node.classes.push(error_class).join(' ') unless !node.elem? || node[:type] == 'hidden' || node.classes.include?(error_class) }
- nodes.to_html
- else
- html_tag
- end
- end
- end
- ## this throws an error as ActionView being an uninitialized constant when I run "rake db:migrate" on the console. What's up?
Add Comment
Please, Sign In to add comment