You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when you add a new location, you can choose which organization this location belongs to via a dropdown. When you have more than a few handfuls of organizations, a dropdown no longer makes sense. Instead, allowing the user to type the name of the organization would be better. Here are Railscasts on the subject:
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.
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.
Currently, when you add a new location, you can choose which organization this location belongs to via a dropdown. When you have more than a few handfuls of organizations, a dropdown no longer makes sense. Instead, allowing the user to type the name of the organization would be better. Here are Railscasts on the subject:
http://railscasts.com/episodes/399-autocomplete-search-terms?view=asciicast
http://railscasts.com/episodes/102-auto-complete-association-revised
The text was updated successfully, but these errors were encountered: