Spelunking in rapid_forms.dryml, I found this logic to determine
whether a field should be added as a hidden field on a form:
["#{pname}[#{field}]", val] unless val.nil? ||
field.to_sym.in?
(this.class.attr_protected) ||
(this.new_record?
&& val == this.class.column(field).default)
So as best I gather this means that a form's going to be hidden if:
(1) It evaluates to non-nil (like a blank string?)
(2) It's an attr_protected.
(3) It's value is not equal to the column default.
Now, I don't fully understand this. And while I know it's bad coding
style, 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. Plus, on my browser, if I DO have a #foo form field
later on, any value in there doesn't get submitted.
At the least, should the val.nil? be val.blank?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---