wackimonki


Member since 02/26/2007

Website: http://1000milejourney.com

6 snippets

135 profile views

1 Comment(s) Posted

View their favorites

Profile

Achievement

first submission:submitting first snipplet

wackimonki's Recent SnippetsTagged rails



« 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 60 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 56 posted 13 years ago by wackimonki
This will add up all the prices and return it? What does |item| mean exactly?
2 51 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 74 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 55 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 54 posted 13 years ago by wackimonki
« Prev 1 Next »