technically you could copy all object#errors arrays into 1 object and
use that as your error messages but i personally would never. you
could easily in your controller go:
def add_user
@form_type = ''user''
end
and in your view go
<%= error_messages_for @form_type %>
or even make an @errorlist array of all objects to check for errors.
On 8/31/05, Thomas Balthazar <tba-QFKgK+z4sOrR7s880joybQ@public.gmane.org>
wrote:> Hi everybody,
>
> I''m doing my very first app in RoR, and I''m learning RoR
doing this.
> I''ve got a question and I haven''t found an answer yet.
>
> What I have :
> - an admin site, with multiple forms, all included in an
> admin.rhtml layout. (very basic)
>
> What I would like to do :
> - instead of having a :
> "<%= error_messages_for ''user'' %>"
in the user form
> "<%= error_messages_for ''roles''
%>"in the role form
>
> I would like to have a :
> "<%= error_messages_for ''__curent_from__''
%>"
> in one place in my admin.rhtml template.
>
> So, my question : what can I specify instead of
''__curent_from__''.
> Is there a specific variable that tells me in which form I am?
>
> Your help will be much appreciated.
> Regards,
> Thomas Balthazar.
>
> P.S. : sorry if duplicated, but I sent it 20 hours ago, and still
> don''t see it in the mailing-list
>
>
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Zachery Hostens <zacheryph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>