Created
March 1, 2012 20:11
-
-
Save VirtuosiMedia/1952798 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
def update | |
@admin = Admin::Admin.find(params[:id]) | |
respond_to do |format| | |
if params[:admin_admin][:change_password] | |
#call update_password here | |
else | |
if @admin.update_attributes(params[:admin_admin]) | |
flash[:success] = "'#{@admin.name}' was successfully updated." | |
format.html { redirect_to admin_admins_path } | |
else | |
format.html { render action: "edit" } | |
end | |
end | |
end | |
end | |
def update_password | |
@admin = Admin::Admin.find(params[:id]) | |
respond_to do |format| | |
if @admin.update_attributes(params[:admin_admin]) | |
flash[:success] = "'Password was successfully changed." | |
format.html { redirect_to admin_admins_path } | |
else | |
format.html { render action: "change_password" } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment