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 add_to_cart | |
| @cart = find_cart | |
| product = Product.find(params[:id]) | |
| quantity = params[:quantity] | |
| quantity ||= 1 | |
| if quantity.to_i > product.quantity.to_i | |
| logger.info "This product only has #{product.quantity.to_i} remaining." | |
| render :nothing => true, :status => 400 and return | |
| else |
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
| <select name="product[tag_ids][]"> | |
| <option></option> | |
| <%= options_from_collection_for_select(tag.children, "id", "name") %> | |
| </select> |
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
| Inflector.inflections do |inflect| | |
| inflect.plural 'still life' | |
| inflect.singular 'still lives' | |
| 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
| <html> | |
| <head> | |
| <title>test</title> | |
| </head> | |
| <body> | |
| <h1>testing gist</h1> | |
| <script src="http://gist.github.com/3806.js"></script> | |
| </body> | |
| </html> |
NewerOlder