> if you do something like this in your controller:
>
> m = Model.new
> m.foo = "non-default-value"
>
> You basically get #foo as a hidden field on your form. Probably not
> what you expected.

My take is that if you're setting a field, then you want that field to  
be set, both on the "new" page and later in the DB when you save the  
thing. That's why the hiddens are added. *Maybe* they should be off by  
default, if that's less surprising. Then again, if you never surprise  
people, you can never move forwards.

> Plus, on my browser, if I DO have a #foo form field
> later on, any value in there doesn't get submitted.

It is supposed to automatically remove the hidden if you have a  
corresponding input. Are you rendering the form field using the  
regular <input> tag without a name attribute?

> At the least, should the val.nil? be val.blank?

Hmmm that's a bit tricky. I'm inclined to leave it as is, as it's been  
working for me, but I'm happy to look at examples where val.blank?  
would work better.

Tom


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to