Forum: Ruby on Rails how to manage errors in ARes?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Patrick A. (Guest)
on 2007-07-08 00:50
(Received via mailing list)
how to manage errors in ARes?
Hey all,

I have that function:

 def create
    @profile =[:profile])

    respond_to do |format|
        flash[:notice] = 'Profile was successfully created.'
        format.html { redirect_to profile_url(@profile) }
        format.xml  { head :created, :location => profile_url(@profile)
        format.html { render :action => "new" }
        format.xml  { render :xml => @profile.errors.to_xml }

Now when I create a profile from ARes with wrong information, I don't
get the same error I would get normally. I only get some http errors,
not the activeRecord ones, isn't @profile.errors.to_xml supposed to
send me the ActiveRecord errors? if yes, how can I get that errors.xml

Thanx in advance

This topic is locked and can not be replied to.