JumpstartLab/curriculum — pull request #504 by lau03229 (2013-04-13 15:59:34+00:00)
Title: Colms updated merchant

Hi, I stumbled across the jumpstartlabs tutorial site a few weeks ago and I've been slowly working my way through the material. I think it's a really great site and I'm enjoying working my way through all the stuff on there so thanks for all the hard work you guys have put into it!

I seen the note about the Merchant tutorial needing revisions so I thought it'd be good to contribute to the project with some fixes and suggestions that I came up with while working through it.

This is the first pull request I've done so I'm not too sure if I've done it right but here is a summary of changes:

- updated the rails version to the 3.2.13
- removed a reference to adding attr_accessible since this is added automatically (by the generator I think?)
- changed the location of the stylesheet to be app/assets/styles.css
- moved the location of the flash in application.html.erb since it wasn't showing up correctly
- added a hint about content_tag in the section about print_stock
- slightly changed the logic in print_stock because as it was the 'out of stock' line was never getting called
- removed the to_i method from the order_item update method and added a section explaining why
- changed all references of customer_id to user_id. The column name in the orders table should be user_id, not customer_id.This was giving an error
- removed the before_filter from the products_controller completely and in the order_items controller I ensured that the before filter was only called before the create method. (I don't see why the load_order method would need to be called in the product_controller at all).
- rearranged some lines about the load_order method to make up for the last change

I hope at least some of this is useful and can be used to help improve the tutorial

Regards

Colm