Created
March 17, 2010 14:16
-
-
Save jathayde/335269 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 index | |
@purchase = Purchase.new | |
end | |
# this page is loaded and is the root_path |
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 create | |
@purchase = Purchase.new(params[:purchase]) | |
if @purchase.save | |
flash[:notice] = 'Thanks!' | |
else | |
flash[:error] = 'That didn\'t work, yo' | |
end | |
redirect_to(root_path) | |
end |
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
Processing PurchasesController#create (for 127.0.0.1 at 2010-03-17 10:05:18) [POST] | |
Parameters: {"commit"=>"Submit", "purchase"=>{"zip"=>"12098", "buy"=>"yes", "why"=>"No reason", "email"=>"[email protected]"}, "authenticity_token"=>"Hcf09tKEVnW/+/wQ5l6GgJQcK3QFe6eQefuVKPDiFfU="} | |
Purchase Load (0.2ms) SELECT "purchases".id FROM "purchases" WHERE ("purchases"."email" = '[email protected]') LIMIT 1 | |
Redirected to http://localhost:3002/ | |
Completed in 16ms (DB: 0) | 302 Found [http://localhost/purchases] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment