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
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 City resource (CitiesController only needs index action which responds to json, City model consists of name and count and does not have its own table, it delegates queries to Address).
Autocomplete list should display the name and the number of parkings for each city.
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:
City
resource (CitiesController
only needsindex
action which responds tojson
,City
model consists of name and count and does not have its own table, it delegates queries toAddress
).Explanation of flow:
/cities.json
,CitiesController#index
method callsCity.search
method,City.search
method callsAddress.with_city_like
query, adds SQL grouping by city name and counting,City.search
method maps results of queries toCity
objects and returns them,CitiesController#index
method responds with city results, which are converted to JSON by Rails.The text was updated successfully, but these errors were encountered: