title: Overriding ActionView::Base.field_error_proc in RefineryCMS
body: <p>I'm trying to have client-side validation errors show up inline, using the client_side_validations gem (https://github.com/bcardarella/client_side_validations) in my refineryCMS app.</p>
  
  <p>When I tab out of an invalid field, it gets wrapped in a span.fieldWithErrors tag, as expected, so I know that the javascript validations are working. However, I am unable to have the error messages show up, even after overriding ActionView::Base.field_error_proc.</p>
  
  <p>I have a feeling that my initializer is being subsequently overridden by refinery (?):</p>
  
  <p>In config/initializers/client_side_validations.rb:</p>
  
  <pre><code># Uncomment the following block if you want each input field to have the validation messages attached.
  ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
    unless html_tag =~ /^&lt;label/
      %{&lt;div class="field_with_errors"&gt;#{html_tag}&lt;label for="#{instance.send(:tag_id)}" class="message"&gt;#{instance.error_message.first}&lt;/label&gt;&lt;/div&gt;}.html_safe
    else
      %{&lt;div class="field_with_errors"&gt;#{html_tag}&lt;/div&gt;}.html_safe
    end
  end
  </code></pre>
  
  <p>I have also tried setting the field_error_proc from config/application.rb using something along the lines of </p>
  
  <pre><code>config.action_view.field_error_proc = Proc.new { |html_tag, instance| # etc... }  
  </code></pre>
  
  <p>Neither of these seem to have any effect on the rendering invalid fields. Any ideas??</p>