Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I just started my rails. I try to set routes but my controller format has an underline. Therefore I do not how to write route.

What I have tried:

This is my controller file name:
method_types_controller.rb


This is what I have tried on my route:
Rails.application.routes.draw do

  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
  get 'method_type/index'
  root 'method_type#index'

end


The result shows incorrectly:
routing error
uninitalized constant MethodTypeController
Posted
Comments
Richard MacCutchan 30-Mar-19 4:36am    
You have created a constant but not given it a value. I would suggest a more detailed study of the documentation and reference guides.
Member 14200783 30-Mar-19 4:38am    
I have solved this problem since the index file is not in a correct path.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900