On 28 Oct 2008, at 14:17, Michael D. Ivey wrote:

> Those docs lie, apparently.
>
> Look in merb-helpers/lib/merb-helpers/form/builder.rb around line 366,
> and you'll see the code.  It never touches the `before' arg.
>
> What did you expect it to do if before == false?

Well, and this was being hopeful maybe, but find the form generated  
off the object and add its errors inline.  #text_field already  
generates <label>s as well as <input>s, so I thought it could generate  
error message <span>s along the lines of the bits I commented out here:

   = error_messages_for(@item, :before => false)

   = form_for(@item, :action => url(:items) ) do
     %p
       %span= text_field :name, :label => "Item name"
       /%span= attribute_errors(@item, :name)
     %p
       %span= text_field :description, :label => "Description"
       /%span= attribute_errors(@item, :description)
     %p
       %span= text_field :location, :label => "Item location"
       /%span= attribute_errors(@item, :location)

It would be nice if it did!

Ashley

-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to