This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
| html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe | |
| # add nokogiri gem to Gemfile | |
| form_fields = [ | |
| 'textarea', | |
| 'input', | |
| 'select' | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #require 'rubygems' | |
| require 'pp' | |
| #require 'ap' # Awesome Print | |
| class Object | |
| # expects [ [ symbol, *args ], ... ] | |
| def recursive_send(*args) | |
| args.inject(self) { |obj, m| obj.send(m.shift, *m) } | |
| end | |
| end |