Hi
Is there a simple way to defined instance variables in a Hobo Model that
are not persisted in the database, and only shown in edit forms.
As an example, there's a need in an input form for an end-user to
communicate to the validation routines that they know they are doing
something stupid. Once validation is completed, there is no real need to
store, or show, the flag.
As an example, something like:-
class Customer < ActiveRecord::Base
hobo_model
fields do
name :string
phone :string
phone_not_avail :boolean, default => false, :persist => false
email :string
email_not_avail :boolean, default => false, :persist => false
end
validates_presence_of :phone, :unless => :phone_not_avail
validates_presence_of :email, :unless => :email_not_avail
end
Where "persist" might be the option to indicate that the field is not to
be stored.
I suspect the simplest work around is to just accept that these flags
will be stored in the database.
I've only been using Hobo/Rails for a couple of months, so I apologize
if I missed something obvious in the documentation.
Thanks
Tim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn:Timothy Hunt
n:Hunt;Timothy
adr:;;106 Erie Street;Jersey City;NJ;07302;USA
email;internet:[email protected]
tel;work:201-830-1912
tel;home:201-656-7795
tel;cell:917-885-9737
x-mozilla-html:TRUE
url:http://www.timhunt.net
version:2.1
end:vcard