Hi folks. I''m looking to emulate a feature I have implemented in Rails routing of old, where the above URL could be used as so... By year: http://douglasfshearer.com/blog/2007 By month: http://douglasfshearer.com/blog/2007/5 By Day: http://douglasfshearer.com/blog/2007/5/28 I''ve had a few attempts at this, but have so far failed to figure it out. Any suggestions? -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
I''d recommend against this for usability reasons and seo reasons...but if you are really set on it there is an example in the agile book. Though that uses traditional routing -- restful may be a bit harder... The domain.com/blog/id-permalink style makes much more sense and will get your more google-fu. - rob On 5/29/07, Douglas Shearer <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi folks. > > I''m looking to emulate a feature I have implemented in Rails routing of > old, where the above URL could be used as so... > > By year: http://douglasfshearer.com/blog/2007 > > By month: http://douglasfshearer.com/blog/2007/5 > > By Day: http://douglasfshearer.com/blog/2007/5/28 > > I''ve had a few attempts at this, but have so far failed to figure it > out. > > Any suggestions? > > -- > Posted via http://www.ruby-forum.com/. > > > >-- http://robsanheim.com http://seekingalpha.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 -~----------~----~----~----~------~----~------~--~---
Rob Sanheim wrote:> The domain.com/blog/id-permalink style makes much more sense and will > get your more google-fu.I already have this implemented in old style routes, with named permalinks for my posts. The dated archive is to save having to paginate through 100s of posts, and to make searching a little easier. -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
why REST? will you be doing CRUD operations on them? if it''s just an archive, then isn''t the routing you have already sufficient? On May 29, 8:27 am, Douglas Shearer <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Rob Sanheim wrote: > > The domain.com/blog/id-permalink style makes much more sense and will > > get your more google-fu. > > I already have this implemented in old style routes, with named > permalinks for my posts. > > The dated archive is to save having to paginate through 100s of posts, > and to make searching a little easier. > > -- > Posted viahttp://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
Jeff Emminger wrote:> why REST? will you be doing CRUD operations on them? if it''s just an > archive, then isn''t the routing you have already sufficient?A very good point. I guess I just wondered if it was at all possible. -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
if you still want REST, (and i''m a rest noob so this may be very wrong), perhaps something like mydomain.com/blog/year/2007/month/5/day/28 On May 29, 11:48 am, Douglas Shearer <rails-mailing-l...@andreas- s.net> wrote:> Jeff Emminger wrote: > > why REST? will you be doing CRUD operations on them? if it''s just an > > archive, then isn''t the routing you have already sufficient? > > A very good point. > > I guess I just wondered if it was at all possible. > > -- > Posted viahttp://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
Jeff Emminger wrote:> mydomain.com/blog/year/2007/month/5/day/28That would work, using nested resources. Have decided I was being stupid, and have re-implemented my map.connect. Ta. -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
On May 29, 11:50 am, Douglas Shearer <rails-mailing-l...@andreas- s.net> wrote:> Jeff Emminger wrote: > > mydomain.com/blog/year/2007/month/5/day/28 > > That would work, using nested resources. Have decided I was being > stupid, and have re-implemented my map.connect.If it''s not too late, let me throw in my two cents :-) REST != map.resources This is a common perception, because DHH''s posts about REST usually included instructions about map.resources, a feature new to Rails 1.2 that made routing easier *in some cases*. But you can have a 100% RESTful application just by using map.connect, too. After all, map.resources is just shorthand for a bunch of named routes (and named routes are just map.connect statements). The url part after blog/ identifies your resource, right? So you can be RESTful: map.connect /blog/:year:/:month/:day, :controller => :blog, :action => :index Then your BlogController has: def index month = params[:month] year = params[:year] day = params[:day] @entries = # get entries here end I''m simplifying, but hopefully you get the idea. You can have a RESTful architecture whether you use map.connect or map.resources. Jeff softiesonrails.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 -~----------~----~----~----~------~----~------~--~---
Jeff Cohen wrote:>You can have a > RESTful architecture whether you use map.connect or map.resources.Awesome reply Jeff, and a point very well made. I think that you should make a blog entry of that, you have the spiel down to a tee. Cheers. Dougal http://douglasfshearer.com -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
> Awesome reply Jeff, and a point very well made.Thanks Douglas! Glad to help.> I think that you should make a blog entry of that, you have the spiel > down to a tee.softiesonrails.com/tags/rest :-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the comment here! http://www.dealsourcedirect.com/ion-tape2pc.html -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.