Created
July 22, 2009 21:20
-
-
Save nsanta/152286 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 copy | |
@account_profile = AccountProfileTemplate.find(params[:based_on]) | |
@account_profile = AccountProfileTemplate.new(@account_profile.attributes.merge(:name => params[:name])) | |
respond_to do |format| | |
if @account_profile.save | |
flash[:notice] = "The Account Profile has been copied" | |
format.js{redirect_to admin_account_profiles_path} | |
else | |
flash[:notice] = "The Account Profile has NOT been copied" | |
format.js{redirect_to admin_account_profiles_path} | |
end | |
format.html{redirect_to admin_account_profiles_path} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment