Re: Errors and flash[:error]

Miguel A.
Thu, 24 May 2012 14:18:20 -0000

> I provide a form, of sorts, for creating HABTM relationships between
> two other models.

Not sure if I understand your issue, but I believe you are looking at
nested resources and nested forms.

> I''d like to provide a bullet list of the combined results of
> validation errors and session matching errors.
Rails can do this automatically for you if you generate a scaffolding.
But if you are looking for going through the created hash for the
message, take a look at:
http://railscasts.com/episodes/18-looping-through-flash

> The UI on my form should prevent both types of errors. So from the end
> user''s perspective there is no meaningful difference.

You must to the attribute verification in its own model, rails will take
care of the rest, the flash error message will display the validations
for both models.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org