Thanks Walter, for your reply.
The tutorial is a year or so old. They are using a slightly older version,
but still 4.0+.
I am running the current stable build of Rails, which is 4.1.2. For a
webserver, it was recommended that I run what they are running in the
tutorial, which is WEBrick.
I installed everything within the past week, so all software components
should be current.
I am running "rails s" in Terminal and it shows WEBrick running and logs
info when pages are accessed, redirected, etc.
My routes.rb file is the installed default. Here it is:
Rails.application.routes.draw do
root "demo#index"
#get 'demo/index'
match ':controller(/:action(:id))', :via => :get
end
Thanks in advance for your help!
On Saturday, July 5, 2014 7:34:50 AM UTC-5, Walter Lee Davis wrote:
>
>
> 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] <javascript:>.
> > To post to this group, send email to [email protected]
> <javascript:>.
> > 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/46523917-ee7d-4ab2-8c34-e9409789af1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.