I am trying to learn ruby and learn how to handle a while request round trip.
On my index.html.erb page I added this line:
<%= link_to "Alex Link", test_path(@test) %>
but I got an error:
undefined method `test_path' for #<#<Class:0x4064e80>:0x3c0b5c8>
As I understand it, I need to add a record to routes.rb, and then a controller. Correct? How do I do that?
I read the explanation for this in the Rails Guides, but just finding it a bit confusing doing it the first time.
For your purposes (learning)
resources testsif fine.It also gives you other routes for free, see RESTful routes.