Class: Renalware::Hospitals::WardsController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/hospitals/wards_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Instance Method Details

#indexObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/renalware/hospitals/wards_controller.rb', line 8

def index
  authorize Ward, :index?
  unit = Unit.find(params[:unit_id])
  wards = Ward.where(hospital_unit_id: unit.id).order(name: :asc).select(:id, :name)
  respond_to do |format|
    format.json do
      render json: wards.to_json
    end
  end
end