Class: EgovUtils::PeopleController

Inherits:
ApplicationController show all
Defined in:
app/controllers/egov_utils/people_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/egov_utils/people_controller.rb', line 6

def index
  @people_schema = PersonSchema.new
  @people_schema.from_params(params)
  respond_to do |format|
    if params['_type'] == 'query'
      format.json{ render json: {
        results: @people_schema.entities.collect do |p|
            {id: p.id, text: p.to_s, residence: p.residence.to_s}
          end
      }}
    else
      format.json{ render json: @people_schema }
    end
  end
end

#showObject



22
23
# File 'app/controllers/egov_utils/people_controller.rb', line 22

def show
end