Hey all
Just a quick one about custom form builders...
I currently have:
class TaggedBuilder < ActionView::Helpers::FormBuilder
#Creates HTML for views
def self.create_tagged_field(method_name)
define_method(method_name) do |label, *args|
@template.content_tag("div",
# div content
@template.content_tag("div",
"\n" + @template.content_tag(''label'',
label.to_s.humanize,
:for =>
"#{@object_name}_#{label}"),
:class => ''column general'') +
"\n" + @template.content_tag("div", super, :class
=> ''column
general''),
:class => ''table-row auto-height left-align'')
end
end
field_helpers.each do |name|
create_tagged_field(name)
end
end
But i want to add in what is effectivly error_messages_on(:object,
:method), but ive no idea what the syntacx should be to put it in in
this context? as if i try that - not expecting it to work - it errors!
undefined method `error_messages_on'' for
#<TaggedBuilder:0x27886f0>
Any help would be great
Cheers
Tim
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---