Notes posted by RafaelPerea
RSS feed
0 thanks
BEWARE of options[:value] in a partial
No problem with new records however,
the following line will not display the current @ecard value on EDIT but ‘contact@host.com’.
text_field :ecard, :sender, :value => 'contact@host.com'
Don’t let your views take control, but if you insist:
text_field :ecard, :sender, :value => f.object.ecard.blank? ? 'contact@host.com' : f.object.ecard
This doesn’t make sense, since when this object was created they deleted the default, which made it blank. Why would they want it back?