Created
February 10, 2009 16:45
-
-
Save ubermajestix/61454 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is from my users_controller file | |
def reset_password | |
# reset user's password here... | |
respond_to do |format| | |
format.html { redirect_to(users_url) } | |
format.js do | |
render :update do |page| | |
# this is where I had a bunch of page. calls that I called in several methods | |
# they've all disapeared into the replace_user_row method | |
replace_user_row(page) | |
end | |
end | |
end | |
end | |
helper_method :replace_user_row | |
def replace_user_row(page) | |
page.replace_html dom_id(@user), :partial => "users/user_row", :locals=>{:user=>@user} | |
page.replace_html "manage_#{dom_id(@user)}", :partial => "user_actions", :locals=>{:user=>@user} | |
page.show "manage_#{dom_id @user}" | |
page.show "close_#{dom_id(@user)}" | |
page.hide "loading_#{dom_id(@user)}" | |
page.hide "open_#{dom_id(@user)}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment