Skip to content

Instantly share code, notes, and snippets.

View nsanta's full-sized avatar

Nicolas Santa nsanta

  • Rio Cuarto, Cordoba, Argentina
View GitHub Profile
@nsanta
nsanta / gist:188604
Created September 17, 2009 17:28 — forked from bscofield/gist:181842
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
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}