Hongliang Zhang
2007-Nov-15 12:03 UTC
How to deal with caches_page with two or more params.
I have added the new map.connect in routes.rb like this map.connect '':controller/:action/:id/:page'' but it seems like the cache_pages only create the controller_name/action_name/id.html file in the public directory. and I expect the controller_name/action_name/id/page.html for different id number the rails create a series page number html files in a directory named with the id. What should I do? I have search for a few days and can''t find the answer. Could anyone help me? -- 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 -~----------~----~----~----~------~----~------~--~---
David A. Black
2007-Nov-15 12:15 UTC
Re: How to deal with caches_page with two or more params.
Hi -- On Thu, 15 Nov 2007, Hongliang Zhang wrote:> > I have added the new map.connect in routes.rb like this > > map.connect '':controller/:action/:id/:page'' > > but it seems like the cache_pages only create the > controller_name/action_name/id.html file in the public directory. > > and I expect the controller_name/action_name/id/page.html > > for different id number the rails create a series page number html files > in a directory named with the id. > > What should I do? > > I have search for a few days and can''t find the answer. > > Could anyone help me?Where in your routes.rb file do you have that route? I''m wondering whether another route is matching first. Here''s what I did to simulate what you''ve got: map.connect '':controller/:action/:id/:extra'' and then connected to: http://localhost:3000/items/show/1/extra and I got this file created: public/items/show/1/extra.html So it should work, which makes me think maybe it''s a route ordering problem. David -- Upcoming training by David A. Black/Ruby Power and Light, LLC: * Advancing With Rails, Berlin, Germany, November 19-22 * Intro to Rails, London, UK, December 3-6 (by Skills Matter) See http://www.rubypal.com for details! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hongliang Zhang
2007-Nov-15 12:30 UTC
Re: How to deal with caches_page with two or more params.
Thanks David. You are right. now the cache pages are created. Thank you very much for your help. -- 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 -~----------~----~----~----~------~----~------~--~---