On Jul 5, 2014, at 2:45 AM, Jay Garnett wrote:

> I'm the ultimate newb on ROR.  I am following through a tutorial on Lynda.com 
> called "Ruby on Rails 4 Essential Training".  I am learning about the MVC 
> structure.  They show a web page that has the following links:
> 
> <a href="/demo/hello">Hello page 1</a><br />
> <%= link_to('Hello page 2', {:action => 'hello'}) %><br /> 
> 
> According to the tutorial, both links, once rendered, should be identical, 
> but they are not and I can't figure out why.
> 
> This is what is being rendered:
> 
> <a href="/demo/hello">Hello page 1</a><br
>  />
> 
> <a href="/demo">Hello page 2</a><br />
> 
> Again, the tutorial shows the second link as /demo/hello.  Why doesn't this 
> link to the hello action the way it should?
> 
> Here is the controller, if that helps:
> 
> class DemoController < ApplicationController
> 
>   layout false
> 
>   def index
>     render('index')
>   end
> 
>   def hello
>     render('hello')
>   end
> 
> end
> 
> 
> Thanks for your help.

What version of Rails are you using, and is it exactly the same version as 
specified in the tutorial? (Patch level doesn't matter as much as major and 
minor version.)

Since you're not getting an error, it's hard to say why this is working out 
this way. Are you running the code using a server in your Terminal? (Did you 
start the server with rails server in the project directory?)

What does your routes.rb file look like?

Walter

> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/20843245-d2fc-431d-aa30-5601778f982d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/DBE4BBA7-843D-4D18-9867-608626BF590B%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to