-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Milestone
Description
City search should have the autocomplete functionality, i.e. it should list the matching cities as the user is typing the name.
Things to do:
- Install JQuery UI plugin.
- Add JS code to connect autocomplete to city search field.
- Add CSS styling to autocomplete elements.
- Create
Cityresource (CitiesControlleronly needsindexaction which responds tojson,Citymodel consists of name and count and does not have its own table, it delegates queries toAddress). - Autocomplete list should display the name and the number of parkings for each city.
Explanation of flow:
- autocomplete JS code calls
/cities.json, CitiesController#indexmethod callsCity.searchmethod,City.searchmethod callsAddress.with_city_likequery, adds SQL grouping by city name and counting,City.searchmethod maps results of queries toCityobjects and returns them,CitiesController#indexmethod responds with city results, which are converted to JSON by Rails.