Hi,
I want to add a form helper in a content_tag like this:
def custom_field(form, attribute_name, form_helper, message = "")
error = form.object.errors.get(attribute_name).present?
klasses = ["clearfix"]
klasses << "error" if error
content_tag :div, :class => klasses.join(", ") do
form.label :attribute_name
content_tag(:div, :class => :input) do
form.send(form_helper, attribute_name, :class => (error ?
"error" : nil))
content_tag :span, :class => "help-inline" do
form.object.errors.get(attribute_name)
end
end
end
end
This works but the form helper aren''t rendered. What do I have to do to
render the form helpers??
Gregory
--
Posted via http://www.ruby-forum.com/.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.