add a route to search via orgname
This commit is contained in:
parent
7ca243b324
commit
4881609ee7
2 changed files with 6 additions and 0 deletions
|
@ -12,4 +12,9 @@ class CnasController < ApplicationController
|
||||||
@cna = Cna.find_by_cna_id(params[:cna_id])
|
@cna = Cna.find_by_cna_id(params[:cna_id])
|
||||||
render json: @cna.to_json
|
render json: @cna.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show_for_orgname
|
||||||
|
@cna = Cna.find_by(:organization_name => params[:organization_name])
|
||||||
|
render json: @cna.to_json
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,5 +28,6 @@ Rails.application.routes.draw do
|
||||||
get "/cnas", to: "cnas#index"
|
get "/cnas", to: "cnas#index"
|
||||||
get "/cnas/:id", to: "cnas#show"
|
get "/cnas/:id", to: "cnas#show"
|
||||||
get "/cnas/cna/:cna_id", to: "cnas#show_for_cna"
|
get "/cnas/cna/:cna_id", to: "cnas#show_for_cna"
|
||||||
|
get "/cnas/organization_name/:organization_name", to: "cnas#show_for_orgname"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue