Since form_for takes the trouble of wrapping up form data in a sub-hash for us, we can directly hand the sub-hash to Picture.new and picture.update_attributes to shorten up our create and update methods a bit. However, for security reasons, if you want to mass-assign attributes in one line of code like this, then you must whitelist which columns are allowed to be mass-assigned by using the attr_accessible method in your model.
The named route helper methods that represent URLs with dynamic segments require inputs to fill in those placeholders. However, if you give it a model object instead of a number or a string, the helper methods are smart enough to pull the id of the object and use that instead. This allows us to make our code just a smidgen cleaner.
The link_to helper method requires two arguments. 1) What you want the user to click, and 2) where the user should be sent when they click it. Therefore, we would expect that the second argument must be a string containing a URL, but the link_to method is smart enough that if you just give it a model object, it will guess that you want the user to go to the show page for that object and guess the URL for you. This only works, like form_for, if you name your routes conventionally. This allows us to make our code just a smidgen cleaner, and reveal our intent for that link better.