routes as explained in RoR tutorial 2nd Ed?

Posted by 7stud on Stack Overflow See other posts from Stack Overflow or by 7stud
Published on 2012-08-29T03:18:32Z Indexed on 2012/08/29 3:38 UTC
Read the original article Hit count: 196

Filed under:
|

The author, Michael Hartl, says:

Here the rule:

get "static_pages/home"

maps requests for the URI /static_pages/home to the home action in the StaticPages controller.

How? The type of request is given, the url is given, but where is the mapping to a controller and action? My tests all pass, though.

I also tried deleting all the actions in the StaticPagesController, which just looks like this:

class StaticPagesController < ApplicationController
  def home
  end

  def about
  end

  def help
  end

  def contact
  end
end

...and my tests still pass, which is puzzling.

The 2nd edition of the book(online) is really frustrating. Specifically, the section about making changes to the Guardfile is impossible to follow. For instance, if I instruct you to edit this file:

blah blah blah
dog dog dog
beetle beetle beetle
jump jump jump

and make these changes:

blah blah blah
.
.
.
go go go
.
.
.
jump jump jump

...would you have any idea where the line 'go go go' should be in the code?

And the hint for exercise 3.5-1 is flat out wrong. If the author would put up a comment section at the end of every chapter, the rails community could self-edit the book.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about routing