Hi,

If you have your own way of handling errors in your views, you can
disable rails default encapsulation by doing

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
   html_tag
end

inside an initializer.

and so no "field_with_errors" div will be wrapped around your fields.

On Oct 5, 10:27 am, Colin Law <clan...@googlemail.com> wrote:
> On 5 October 2010 08:07, Mauro <mrsan...@gmail.com> wrote:
>
>
>
> > On 5 October 2010 04:05, Butu <but...@gmail.com> wrote:
> >> Hello Mauro,
>
> >> <div class="field_with_errors"> tag is created in ActionView::Base
> >> class only in case of any errors.
>
> >> From Rails code base:-
>
> >>    # Specify the proc used to decorate input tags that refer to
> >> attributes with errors.
> >>    cattr_accessor :field_error_proc
> >>    @@field_error_proc = Proc.new{ |html_tag, instance| "<div
> >> class=\"field_with_errors\">#{html_tag}</div>".html_safe }
>
> >> Thanks!
> >> Butu
>
> > ....and if I don't want those divs?
>
> For my education, why would you object to them being there?
>
> Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to