wackimonki


Member since 02/26/2007

Website: http://1000milejourney.com

6 snippets

140 profile views

1 Comment(s) Posted

View their favorites

Profile

Achievement

first submission:submitting first snipplet

wackimonki's Recent Snippets



« Prev 1 Next »
Renders the partial template called 'cart', sends along local variable @cart, this will be known locally using the same name as the partial, 'cart'.
1 62 posted 13 years ago by wackimonki
The code tests if session[:counter] exists. If you leave out the all important '?', it will fail with an error.
1 58 posted 13 years ago by wackimonki
This will add up all the prices and return it? What does |item| mean exactly?
2 53 posted 13 years ago by wackimonki
Redirects from one method to another in a controller. This is handy when there's an error, and you need to go back to index page, or for other purposes.
1 78 posted 13 years ago by wackimonki
Adds a button in view, which triggers a method. "Empty cart" is the button name empty_cart is the method name
1 57 posted 13 years ago by wackimonki
Catches an exception error, uses a technique called flash to display error on another page. The Ruby on Rails code needs to be in a controller. The rhtml code needs to be in the index layout.
1 57 posted 13 years ago by wackimonki
« Prev 1 Next »