never mind i solved it
On Sep 23, 4:46 pm, tyliong <[EMAIL PROTECTED]> wrote:
> Hi, when i use the updatepassword action, it does not refresh the ajax
> partial but forces the browser to save a file
> why does that happen?
>
> def updatepassword
> @user = current_user
> return unless request.post?
> if User.authenticate(current_user.login, params[:old_password])
> if ((params[:password] == params[:password_confirmation]) && !
> params[:password_confirmation].blank?)
> current_user.password_confirmation =
> params[:password_confirmation]
> current_user.password = params[:password]
> if current_user.save
> flash[:notice] = "Password successfully updated."
> redirect_to login_path #profile_url(current_user.login)
> else
> flash[:error] = "An error occured, your
> password was
> not changed."
> respond_to do |format|
> format.js
> end
> end
> else
> flash[:error] = "New password does not match the
> password confirmation."
> @old_password = params[:old_password]
> respond_to do |format|
> format.js
> end
> end
> else
> flash[:error] = "Your old password is incorrect."
> respond_to do |format|
> format.js
> end
> end
> end
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---