Class: SearchTownController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/ua_town_finder/search_town_controller.rb

Instance Method Summary collapse

Instance Method Details

#by_queryObject



2
3
4
5
6
7
# File 'lib/ua_town_finder/search_town_controller.rb', line 2

def by_query
  areas = Adapters::Area.new(Api::Area.find_by_title(params[:term])).call
  respond_to do |format|
    format.json { render json: areas }
  end
end