Hi this is ROR beginner’s question.
I have creat controller.rb and view hello.rhtml following the tutorial, but when I try to open localhost:3000/say/hello, it come up with with error: No route matches [GET] “/say/hello”
could any one advice please?
Well you need to setup a route for that in your config/routes.rb file.
For first try i would say use a script generator, enter on the command line as being in the project library >
rails g controller helloworld index. This will create a route for itself, and a controller file.After this script runs, there should be a line in your config/routes.rb
Then you need to enter
localhost:3000/helloworld/indexin your browser url bar. Then ( as default ) rails will render the view located in app/views/helloworld/index.*. If you want to change this behaviour, go to the helloworld controller.For more info there is a useful guide: ROUTING GUIDES