codeforamerica/ohana-api — pull request #229 by monfresh (2014-09-11 05:18:38+00:00)
Title: Allow admin to search for orgs via autocomplete.

Closes #185.

Autocomplete functionality is provided by
[Select2](http://ivaynberg.github.io/select2/) via the select2-rails
gem.

The Select2 field is only enabled for super admins, because regular
admins will only have a small number of organizations to choose from.

Updated the API route and admin controller logic for creating a
location so that `organization_id` is not mass-assignable. Otherwise,
someone could assign a location to any organization by passing in any
organization id by updating the form via browser dev tools for example.

Added uniqueness validation for organization name.