def update @user.attributes = params[:user] @user.save! flash[:notice] = 'Your Profile has been updated' respond_to do |format| format.html { redirect_to user_path(@user) } format.xml { head :ok } end rescue ActiveRecord::RecordInvalid flash[:notice] = 'There was an error while saving your profile' respond_to do |format| format.html { redirect_to edit_user_path(@user) } format.xml { :xml => @user.errors.to_xml } end end