I have been littering stack overflow with quetsions trying to get the books code to work with Rails 3.2 I’m using the fourth edition. Apparently it was designed to work before these MassAssignment security warnings. Now I’m stuck at the following:
# Running tests: [21/32] OrdersControllerTest#test_should_get_new = 0.00 s 1) Error: test_should_get_new(OrdersControllerTest): ActiveModel::MassAssignmentSecurity::Error: Can't mass-assign protected attributes: cart /usr/local/lib/ruby/gems/2.0.0/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security/sanitizer.rb:48:in `process_removed_attributes' /usr/local/lib/ruby/gems/2.0.0/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security/sanitizer.rb:20:in `debug_protected_attribute_removal' /usr/local/lib/ruby/gems/2.0.0/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security/sanitizer.rb:12:in `sanitize' /usr/local/lib/ruby/gems/2.0.0/gems/activemodel-3.2.13/lib/active_model/mass_assignment_security.rb:230:in `sanitize_for_mass_assignment'
I have no idea where to put the attr_accessible token for cart and really feel like giving up now. It took me a good while to figure out the previous mass assignment warnings too.
Hell, even jQuery was a nightmare to get working with rails..
Please advise :/