Skip to content

Instantly share code, notes, and snippets.

@nsanta
Created July 22, 2009 21:20
Show Gist options
  • Save nsanta/152286 to your computer and use it in GitHub Desktop.
Save nsanta/152286 to your computer and use it in GitHub Desktop.
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