Monday, October 4, 2010

Re: [Rails] field_with_errors.

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


On Sat, Oct 2, 2010 at 2:07 AM, Mauro <mrsanna1@gmail.com> wrote:
> If a model doesn't pass validation the field in the view is put under
> a <div class="field_with_errors">.
> But who create that div? field_text helper do it?
>
> --
> 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-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate