Sha256: 5e99c303befea606cfc8a20aac7538d1d0d0a5bc750fa9b8bbb9ea17ab71147a

Contents?: true

Size: 409 Bytes

Versions: 1

Compression:

Stored size: 409 Bytes

Contents

# encoding: utf-8

class Api::PacientesController < ApplicationController
  include APIAuthentication
  before_action :autenticar_token

  def index
    if params[:nome].present?
      render status: 200, json: Paciente.where("nome LIKE \"%#{params[:nome]}%\"").select("id, registro, nome, sexo, data_nascimento, cidade")
    else
      render status: 400, json: { cause: 'nome_required' }
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-sabia-1.0.1 app/controllers/api/pacientes_controller.rb