small medium large xlarge

15 Feb 2011, 17:37 (2 posts)

Windows XP Pro Installed using section 1.1 using ruby-installer-1.9.2-p136.exe

gem -v yields 1.3.7

Section 2.3 page 49 has the following example.

Hello from Rails!

It is now <%= @time %>

Time to say <%= link_to “Goodbye!”, say_goodbye_path %>

When I attempt this I get the following error in the browser.

NameError in Say#hello

Showing D:/Ruby-Work/demo/app/views/say/hello.html.erb where line #7 raised:

undefined local variable or method `say_goodbye_path’ for #<#:0x1c98e28>

Extracted source (around line #7):

4: </p> 5: <p> 6: Time to say 7: <%= link_to “Goodbye!”, say_goodbye_path %> 8: </p>

Rails.root: D:/Ruby-Work/demo

What am I doing wrong? I have actually done a copy and paste on the code to be sure that my syntax is exactly what is in the book.

18 Feb 2011, 20:43
Sam Ruby (634 posts)

Can you verify that config/routes.rb is correct? This routes for say/hello and say/goodbye should have been created on when you generated the controller on page 41.

You must be logged in to comment