kathyw268/wbdv465-project — pull request #1 by mttdffy (2014-02-07 22:18:07+00:00)
Title: Fixes for "Blank Scaffold"

So you had a number of issues that I'm not sure how they happened.

First, you had added the `protected_attributes` gem into your project which adds back legacy functionality from rails 3.2. This was what was causing your items not to save correctly because that gem protects all attributes in the model by default, preventing the controller from setting values on the `@item.new(item_params)` line. You also over wrote that `item_params` method, which no longer worked as intented. I took out the gem, made the changes to your user model that were needed to not cause errors.

Also, you had some extra files, like two views for each action in your item views, as well as the scaffold css file you don't need. These were breaking anything necessarily, but could cause expected behaviors.

I also fixed your user association to items. You created a migration to add `users_id` to your item. Foreign keys are singular, `user_id`, as well as needing to set the `belongs_to :user` on your item model. I also cleaned up the view and controller so that the current user is the one that is set on the user. This will cause an error if you try to create an item as a guest, but you can uncomment the `if current_user` next to that line in the controller if you want to allow guests to create items.