LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2010, 08:29 PM   #1
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Rails: no path for link_to


I'm still going through "Agile Web Development with Rails" (Beta version), and I'm confused as to why some code in the book is not working for me. Following their example code in the book, I created code like so:

Code:
$ rails demo
# ...
$ cd demo/
$ script/generate controller Say index hello goodbye
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/say
      exists  test/functional/
      create  test/unit/helpers/
      create  app/controllers/say_controller.rb
      create  test/functional/say_controller_test.rb
      create  app/helpers/say_helper.rb
      create  test/unit/helpers/say_helper_test.rb
      create  app/views/say/index.html.erb
      create  app/views/say/hello.html.erb
      create  app/views/say/goodbye.html.erb
After starting the server, I can view the index view and the other views just fine. But then I have trouble if I add this code to any of the view html templates:

Code:
<p><%= link_to "Hello", say_hello_path %></p>
I'm told this is supposed to generate a link to the say/hello view. But instead I get an error message like so:

Code:
undefined local variable or method `say_hello_path' for #<ActionView::Base:0xb6ce3090>
If I edit it to

Code:
<p><%= link_to "Hello", Say_hello_path %></p>
then I get

Code:
uninitialized constant ActionView::Base::CompiledTemplates::Say_hello_path
But I haven't noticed anything in the book so far indicating that I am supposed to initialize these constants or how I am supposed to do it. Where have I gone wrong here...?

Last edited by CoderMan; 07-01-2010 at 01:14 PM.
 
Old 07-01-2010, 03:44 PM   #2
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375

Original Poster
Blog Entries: 24

Rep: Reputation: 43
I found the answer (more or less) at another forum. Including the link for posterity:

http://railsforum.com/viewtopic.php?id=39774
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [Ruby on Rails] backticks don't work under rails. bartonski Programming 1 09-08-2009 04:19 PM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 05:48 PM
Rails, Apache and others ... Tegramon Slackware 1 02-07-2008 03:04 PM
LXer: Real world Rails: Caching in Rails LXer Syndicated Linux News 0 05-19-2007 09:16 PM
LXer: Off the Rails? LXer Syndicated Linux News 0 10-24-2006 04:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration