Add update to controllers

This actually does quite a bit more than adding update. I realized most of our controllers had large amounts of duplicated code due to the requirements for the JSON API format, so I attempted to abstract that code out into the JsonApiController module. 

With a few differences, that I'll correct soon, this should fully reflect the published apiary api. There are couple more small things I'd like todo, namely: add specs for each JsonApiController submodule and add scopes to the link creation process. While the module should be pretty well tested by the existing controller specs, I think they should also be tested in isolation. The scopes will be necessary to prevent users from linking to otherwise private workflows and subject sets. 

This closes #147 and #135.
Aren't we going to expose usernames via the /:username/:project_name or
/:username/:collection_name routes on the client?

On Wed, Sep 24, 2014 at 9:30 AM, Campbell Allen <notifications@github.com>
wrote:

> In app/controllers/api/v1/users_controller.rb:
>
> >    end
> >
> > -  def show
> > -    render json_api: UserSerializer.resource(params)
> > +  private
> > +
> > +  def visible_scope
> > +    User.all
>
> do we want to expose usernames? Could be used mechanism for validating
> unknown usernames for use in brute force password guess / account
> manipulation. Especially if the user has their email as their username.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/zooniverse/Panoptes/pull/165/files#r17974207>.
>



-- 
Ed Paget