Sha256: 2193fa5d8d6cedf763cdc7296728249f28d8f53b521abcfb71f22e60a3b7100a

Contents?: true

Size: 568 Bytes

Versions: 31

Compression:

Stored size: 568 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.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

  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
egov_utils-0.3.0 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.13 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.12 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.11 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.10 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.9 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.8 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.7 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.6 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.5 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.4 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.3 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.2 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.1 app/controllers/egov_utils/people_controller.rb
egov_utils-0.2.0 app/controllers/egov_utils/people_controller.rb
egov_utils-0.1.37 app/controllers/egov_utils/people_controller.rb
egov_utils-0.1.36 app/controllers/egov_utils/people_controller.rb
egov_utils-0.1.35 app/controllers/egov_utils/people_controller.rb
egov_utils-0.1.33 app/controllers/egov_utils/people_controller.rb
egov_utils-0.1.32 app/controllers/egov_utils/people_controller.rb