I got this error:
undefined method `test_path' for #<#<Class:0x4022a00>:0x4028ee0>
I made this link:
<%= link_to "Alex Link", test_path(@test) %>
and I made this controller: test_controller.rb
class TestController < ApplicationController
def test
end
end
And I added this to routes.rb
root :to => 'test_path#hello'
Where did I go wrong?
I am just trying to learn how to route ruby controllers by hand.
1st part: put
resources :testinstead of what you have in routes.rb file2nd Answer: Because you dont have a model associated with your controller you are getting that error.
Hope it helps.