Topic: URL Architecture for Tags

I am building a Rails application that is going to depend on tags almost exclusively for navigation. I am using the acts_as_taggable plugin, with updates

Basically I am trying to figure out how to structure the applications urls, as I want it to be page cachable (no user logins, so they are not a problem), and have very clean urls. Here are some examples of what I have so far:

example.com/tag/ruby #Shows stuff that is tagged with ruby
example.com/tag/ruby/recent.xml #RSS feed of recently added stuff with ruby tag

The part I am stumbling on is how to do the tag search URLs. Any ideas for how to do the search? I need both for finding any tag, and finding all tags, and a way to get a cachable recent tag feed for them.

I would like to have clean urls, but a form cannot submit to a url by default. I may be able to use javascript, and a server side script to redirect for those who do not have javascript.

Thanks for your ideas!

Last edited by SRTech (2006-06-01 18:43:19)

Tech Cheat Sheets for Ruby, Rails, and much more!

Re: URL Architecture for Tags

For searching on a single term (i.e. someone searches for "ruby"), you can redirect straight to a tag's page if it exists. If it doesn't exist, create the tag/page and offer a link to the feed for that tag so the user's notified when it updates.

I think you're going to have to bite the bullet and use something less than ideal for complex custom query URLs though. It sucks having to give someone a URL like /feed/1042290 but is that really worse than /feed/term1-term2-term3-term4-term5?

vinnie - rails forum admin

Re: URL Architecture for Tags

Well, I ended up doing it basically the same technorati as their solution was the simplest, and has been tested for a little while. You can see the site here

Tech Cheat Sheets for Ruby, Rails, and much more!

Re: URL Architecture for Tags

I have decided just to have a boolean for 'serialized' in the parts table. However, when creating a tuple for the 'billables' table, I don't want to just leave the serial_number_id field set to <NULL> for all of the non-serialized parts being associated with a Work order.





modern kitchens