Currently running through a ruby on rails guide and I seem to have hit a slight snag. I duplicated a view in one of my view folders:
hello.html.erb and index.html.erb
When trying to access it via browser (localhost:3000/demo/"...") Only the original demo/index works but demo/hello has "No Route Matches"
Add
get "demo/hello" => "your-controller#your/action"
to your routes.rb
For example:
app/controllers/demos_controller.rb:
class DemosController < ApplicationController
def hello
end
end
app/views/demos/hello.html.erb:
<p>Hello World</p>
config/routes.rb:
get "demo/hello" => "demos#hello"
UPDATE: From the comments: check out the rails guide for more details: http://guides.rubyonrails.org/routing.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With