I have a site which is a listing of realestate offerings, written currently in PHP. With complicated .htaccess rules, going to the url site.com/listings/226/aid/29/ref/contact leads to the page listings/prop_view.php?id=226&aid=29&ref=contact... the beauty of this is that the link is SEO friendly and thus gains high rankings in the engines because they will reach it. question is, how would I do this in rails so that I get the same url and not site.com/listings/view/226?aid=29&ref=contact I could write the link dynamicly (without helpers) in the view, but then would rails seperate these into :params? or would I have to do somthing else with the data to map it or connect it? Thanks for helping a noob.
on 2005-12-31 05:50
on 2005-12-31 08:02
On 12/30/05, CodeNinja <email@example.com> wrote: > question is, how would I do this in rails so that I get the same url and > not > site.com/listings/view/226?aid=29&ref=contact > > I could write the link dynamicly (without helpers) in the view, but then > would rails seperate these into :params? or would I have to do somthing > else with the data to map it or connect it? The config/routes.rb file allows you to set up custom routing (similar to mod_rewrite in many respects). It works both ways, so it also affects how URLs in links are formed when using the helper methods in your templates. http://manuals.rubyonrails.com/read/chapter/65 -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland