In your controller you could define a flash message:
def create
@thing = Thing.new(params[:thing])
if @thing.save
flash[:notice] = "Thing was saved correctly."
else
flash[:notice] = "Thing could not be saved: #{@thing.errors.to_s}"
end
end
On Jan 31, 2008 1:05 PM, Tim
<timdw5s-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> in the application.rhtml I am trying to check and see if any of the
> models associated with this controller have errors (i.e. -
> model.errors.count > 0). Does anyone know how to do that using
> reflection or something since I will not know what models are present
> in this controller or action of the controller since it is in the
> shared application.rhtml file??
>
> Thanks!
> >
>
--
Ryan Bigg
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---