Skip to content

Instantly share code, notes, and snippets.

@ravionrails
Created May 24, 2010 07:23
Show Gist options
  • Save ravionrails/411617 to your computer and use it in GitHub Desktop.
Save ravionrails/411617 to your computer and use it in GitHub Desktop.
def new_cart_item
@customer = Customer.new
end
def create_new_cart_item
@customer = Customer.new(params[:customer])
if @customer.save
flash[:notice] = "Successfully created"
redirect_to show_next_item_url(:id => @product)
else
flash[:notice] = "Some error occur"
redirect_to new_cart_item_url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment