Sha256: d9478d882642a77294eca6c77713650c0266c7880d6d7dad51002244e1e544bd

Contents?: true

Size: 611 Bytes

Versions: 6

Compression:

Stored size: 611 Bytes

Contents

module EgovUtils
  class PeopleController < ApplicationController

    load_and_authorize_resource

    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.includes(:residence).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

    def show
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
egov_utils-1.0.3 app/controllers/egov_utils/people_controller.rb
egov_utils-1.0.2 app/controllers/egov_utils/people_controller.rb
egov_utils-1.0.1 app/controllers/egov_utils/people_controller.rb
egov_utils-1.0.0 app/controllers/egov_utils/people_controller.rb
egov_utils-0.7.5 app/controllers/egov_utils/people_controller.rb
egov_utils-0.7.4 app/controllers/egov_utils/people_controller.rb