On Apr 25, 2011, at 12:56 PM, Tuishimi wrote:

> I know in a field you can specify :required, but is there a way to
> narrow the scope of the requirement, like
> saying :required=>[:update]?  I want a field to be required, but ONLY
> during an update...  and I'd rather not HAVE to override the update
> method, but I will if necessary, no biggy.

All that :required does is tell Hobofields to add this to the model:

validates_presence_of :some_field_name

If you skip the :required in the field declaration and use this instead (after 
the fields do block):

validates_presence_of :some_field_name, :on => :update

You'll get the behavior you're looking for.

--Matt Jones

-- 
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