to be a bit more precise about this, the validations DO get
triggered... BUT hobo_create returns invalid, the flash messages from
the validation fails seem to be ignored, the controller proceeds to
redirect and the subsequent show page fails because the current
context includes a nil class (for the contact that didn't get
created).
so actually i'm starting to think that this *is* a hobo bug? I can't
see any reason why the result of validation should not be flagged to
the user, or why the show should be allowed to proceed with an invalid
record?
anyway for what it's worth i've found a workaround by making a
def create_for_company
hobo_create do
if invalid?
flash[:notice] "Validation for contact failed"
redirect_to :back
end
end
end
On 8 May, 12:52, storitel <[email protected]> wrote:
> hi chaps - noob again :-)
>
> i have a contact model, belongs to company. i have validations working
> - so on the contact new action it's not possible to create a contact
> with empty name etc.
>
> but if i have a new contact form on the company show page, the
> validations aren't triggered... as soon as I hit add with an empty
> name the app proceeds until an exception is thrown. is there some
> special plumbing required for validations on child forms?
>
> br
> paul
>
> --
> 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
> athttp://groups.google.com/group/hobousers?hl=en.
--
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.