Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin: Implement autocomplete or typeahead for organizations when adding new location #185

Closed
monfresh opened this issue Jul 17, 2014 · 0 comments · Fixed by #229
Closed
Labels

Comments

@monfresh
Copy link
Member

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

@monfresh monfresh added the admin label Jul 17, 2014
monfresh added a commit that referenced this issue Sep 11, 2014
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.
monfresh added a commit that referenced this issue Sep 11, 2014
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant