-
-
Save cuciferus/4332343 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes: | |
resources :drugs do | |
collection do | |
get :find_by_dci | |
end | |
#match '/drugs/find_by_dci/:id', :controller => 'drugs', :action =>'find_by_dci' | |
resources :line_drugs | |
end | |
controller: | |
def find_by_dci | |
drug = Drug.find(params[:id]) | |
@nume = Drug.where(:dci => drug.dci).select(:nume) | |
respond_to do |format| | |
format.html | |
format.json | |
end | |
end | |
rake routes: | |
find_by_dci_drugs GET /drugs/find_by_dci(.:format) drugs#find_by_dci | |
link: | |
http://192.168.2.2:3000/drugs/find_by_dci/18 with the error: | |
No route matches [GET] "/drugs/find_by_dci/18" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment