Class: Tasks::Gis::GeographicAreaLookupController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/gis/geographic_area_lookup_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#has_shape_paramObject (protected)



27
28
29
30
31
32
33
# File 'app/controllers/tasks/gis/geographic_area_lookup_controller.rb', line 27

def has_shape_param
  begin
    true if params.require(:has_shape)
  rescue ActionController::ParameterMissing
    return false 
  end
end

#indexObject

GET



5
6
# File 'app/controllers/tasks/gis/geographic_area_lookup_controller.rb', line 5

def index
end

#invert_paramObject (protected)



19
20
21
22
23
24
25
# File 'app/controllers/tasks/gis/geographic_area_lookup_controller.rb', line 19

def invert_param
  begin
    true if params.require(:invert)
  rescue ActionController::ParameterMissing
    return false 
  end
end

#resolveObject

GET /tasks/gis/geographic_area_lookup/resolve.js



9
10
11
12
13
14
15
# File 'app/controllers/tasks/gis/geographic_area_lookup_controller.rb', line 9

def resolve 
  begin
    @matches = GeographicArea.matching(params.require(:terms), has_shape_param, invert_param) 
  rescue ActionController::ParameterMissing
    @matches = []
  end
end