Get HTML, XML, and JSON formatted views working for who_bought requests. Experiment with including the order information in the XML view by rendering
@product.to_xml(include: :orders). Do the same thing for JSON.
Hint: use builder templates for XML.
What happens if you click the “Checkout” button in the sidebar while the checkout screen is already displayed? Can you find a way to disable the button in this circumstance?
Hint: variables set in the controller are available in layouts and partials as well as in the directly rendered template.
The list of possible payment types is currently stored as a constant in the
Order class. Can you move this list into a database table? Can you still make validation work for the field?
Hint: Replace the
pay_type string with a
pay_type_id in the
Orders model, and use http://ar.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M000083 to verify that this field is set.
- V27: Denis Hovart [about 1 year ago]
- V26: eric tenne [over 1 year ago]
- V25: George Buckingham [almost 4 years ago]
- V24: William Ko [almost 5 years ago]
- V23: William Ko [almost 5 years ago]
- V22: William Ko [almost 5 years ago]
- V21: William Ko [almost 5 years ago]
- V20: William Ko [almost 5 years ago]
- V19: Sam Ruby [almost 6 years ago]
- V18: Sam Ruby [almost 6 years ago]