23 lines
480 B
Ruby
23 lines
480 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CnasController < ApplicationController
|
|
def index
|
|
@cnas = Cna.all
|
|
render json: @cnas.to_json
|
|
end
|
|
|
|
def show
|
|
@cna = Cna.find(params[:id])
|
|
render json: @cna.to_json
|
|
end
|
|
|
|
def show_for_cna
|
|
@cna = Cna.find_by_cna_id(params[:cna_id])
|
|
render json: @cna.to_json
|
|
end
|
|
|
|
def show_for_orgname
|
|
@cnas = Cna.where('organization_name ILIKE ?', "%#{params[:organization_name]}%")
|
|
render json: @cnas.to_json
|
|
end
|
|
end
|