Rails Routing from the Outside In


I am starting to read the RailsGuides and I figure I'd make notes of errors and minor suggestions as I go along. Please let me know if there is a better way for me to provide continued feedback if email is not the best form.

Following are some of my suggestions for:

Rails Routing from the Outside In

*) 1.1 Connecting URLs to Code

[suggested change]
the request is dispatched to the patients controller�s show action with { :id => �17� } in params.

the request is dispatched to the patients controller�s show action with { :id => �17� }, you can then read the parameter value with params[:id].

*) 1.2 Generating Paths and URLs from Code

the id does not need to be specified in the path helper

<%= link_to "Patient Record", patients_path(@patient.id) %>

<%= link_to "Patient Record", patients_path(@patient) %>

*) In section 2.1 Resources on the Web
why not move the following list to the end of section 2.2 CRUD, Verbs, and Actions for clear demonstration of use

[move following section]
When your Rails application receives an incoming request for
DELETE /photos/17

it asks the router to map it to a controller action. If the first matching route is
resources :photos

Rails would dispatch that request to the destroy method on the photos controller with { :id => �17� } in params.

*) 2.3 Paths and URLs

# edit_photo_path returns /photos/edit

# edit_photo_path(id) returns /photos/:id/edit

*) 2.6 Controller Namespaces and Routing
since other following examples mention singular forms, what is the singular form for

namespace "admin" do
   resources :posts, :comments

*) 3.1 Bound Parameters

at the end of this section it's states:

This route will also route the incoming request of /photos to PhotosController, since :action and :id are optional parameters, denoted by parentheses.

Can you specify what the default action is called? it is index??

*) 3.6 Naming Routes
there seems to be an error on the last sentence

Calling logout_path will return /logout

Calling logout_path will return /exit

Hi Rajinder thanks for your suggestions, I updated the guide with some fixes. You can provide future feedback through email, lighthouse [1] or even you can update the guides yourself [2], the repo has open commit policy

[1] https://rails.lighthouseapp.com/projects/16213-rails-guides

[2] http://guides.rubyonrails.org/contribute.html


thanks I will try to make direct contribution into the repo. For me to pull down a copy from the git repo how do I do this? I can't seem to do a check out, only make a clone with

git clone http://github.com/lifo/docrails.git

I work with Subversion so I understand the concept, is there a git doc or wiki on how I can check out and submit changes directly to docrails?

Thanks again,