Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
only use data that include address
Browse files Browse the repository at this point in the history
Fixes #398
  • Loading branch information
y-yagi committed Jul 9, 2017
1 parent d14f539 commit ae78f91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/places_controller.rb
Expand Up @@ -16,8 +16,12 @@ def show
def new
@need_pages_js = true
@place = Place.new
@places = []

@places = params[:query].present? ? Geocoder.search(params[:query]) : []
if params[:query].present?
places = Geocoder.search(params[:query])
@places = places.select { |place| Place.get_address_from_geocode_result(place) }
end
end

def edit
Expand Down

0 comments on commit ae78f91

Please sign in to comment.