I am reading David''s book "Rails Routing" and it is really helpful. I do have a few questions and there doesn''t seem to be an errata page. Not that I am finding a lot of errors, it is a GREAT book, just a few little things. specifically on page 65 it states: The Routes for show, new, edit and destroy are singular.... I think this is a typo as I can''t see how new, which is a pre-action to create, is singular. Granted the book was written for Rails 1.2.3, but REST has not changed, only Rails PS I also read David''s Ruby for Rails, which, even though it is 2 years old, is still the best Rails book out there. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeremy McAnally
2008-Apr-23 05:54 UTC
Re: Errata site for David A Black''s Rails Routing book?
I think he means you will use `new_thing_path` rather than `new_things_path`. Just as you would use `show_thing_path` or `edit_thing_path` rather than a plural version. `things_path` or any collection methods are the only routes that will be plural. --Jeremy On Wed, Apr 23, 2008 at 1:31 AM, Ruby Freak <twscannell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I am reading David''s book "Rails Routing" and it is really helpful. I > do have a few questions and there doesn''t seem to be an errata page. > Not that I am finding a lot of errors, it is a GREAT book, just a few > little things. > > specifically on page 65 it states: > The Routes for show, new, edit and destroy are singular.... > > I think this is a typo as I can''t see how new, which is a pre-action > to create, is singular. > > Granted the book was written for Rails 1.2.3, but REST has not > changed, only Rails > > PS > I also read David''s Ruby for Rails, which, even though it is 2 years > old, is still the best Rails book out there. > > > >-- http://jeremymcanally.com/ http://entp.com Read my books: Ruby in Practice (http://manning.com/mcanally/) My free Ruby e-book (http://humblelittlerubybook.com/) Or, my blogs: http://mrneighborly.com http://rubyinpractice.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Jeremy, I guess I should have finished the sentence It says: The routes for show, new, edit and destroy are singular because they''re showing and editing a particular thing. The rest of the routes are plural, They deal with the resource as a collection. The singular RESTful routes require an argument because they to know the id of the particular member of the collection on which you''re operating.... My question evolves around the new_thing_url route requiring an "id" argument From my rudimentary understanding, the RESTfull actions/routes named show, update, destroy and edit require an id parameter. new, index and create do not. The list in my mind, of singular routes (as defined above) is different from the one in the book in that mine contains ''update'' and the book''s list contains ''new'' instead. As far as the names having plurals, I haven''t read that far. Maybe 2.0 changed things as I am reading a 1.2.3 book but the show, update and destroy actions are described as being available via things_url(@thing) with method options of ''put'' and ''destroy'', with ''get'' as a default. I have yet to discover the show_thing_path. it''s still things_url(@thing) for me, but I''m not done reading. :-) I will get there, Rails intricacies take time for me to understand. I read most of the teaser chapter, "Ruby under microscope" of your "Ruby in Practice" book. Looks very good, I guess I am going to have to put it in my queue behind the 1200-1500 pages of unread books that I already own and haven''t yet gotten to. Thanks again. On Apr 22, 10:54 pm, "Jeremy McAnally" <jeremymcana...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I think he means you will use `new_thing_path` rather than > `new_things_path`. Just as you would use `show_thing_path` or > `edit_thing_path` rather than a plural version. `things_path` or any > collection methods are the only routes that will be plural. > > --Jeremy > > > > On Wed, Apr 23, 2008 at 1:31 AM, Ruby Freak <twscann...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I am reading David''s book "Rails Routing" and it is really helpful. I > > do have a few questions and there doesn''t seem to be an errata page. > > Not that I am finding a lot of errors, it is a GREAT book, just a few > > little things. > > > specifically on page 65 it states: > > The Routes for show, new, edit and destroy are singular.... > > > I think this is a typo as I can''t see how new, which is a pre-action > > to create, is singular. > > > Granted the book was written for Rails 1.2.3, but REST has not > > changed, only Rails > > > PS > > I also read David''s Ruby for Rails, which, even though it is 2 years > > old, is still the best Rails book out there. > > --http://jeremymcanally.com/http://entp.com > > Read my books: > Ruby in Practice (http://manning.com/mcanally/) > My free Ruby e-book (http://humblelittlerubybook.com/) > > Or, my blogs:http://mrneighborly.comhttp://rubyinpractice.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David A. Black
2008-May-04 13:07 UTC
Re: Errata site for David A Black''s Rails Routing book?
Hi -- On Wed, 23 Apr 2008, Ruby Freak wrote:> > Thanks Jeremy, > > I guess I should have finished the sentence > It says: > > The routes for show, new, edit and destroy are singular because > they''re showing and editing a particular thing. > The rest of the routes are plural, They deal with the resource as a > collection. > The singular RESTful routes require an argument because they to know > the id of the particular member of the collection on which you''re > operating.... > > My question evolves around the new_thing_url route requiring an "id" > argumentIt doesn''t -- it just got lumped in there. Thanks for flagging that. David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---