Hey,

This is more of a general question or Rails question than Rails 
Spinoffs.  Next time, consider posting to RubyOnRails-Talk instead.

Gcompany a écrit :
> how do we convert long url to short url in a rails app like
> snipurl.com or dwarfurl.com

1) Devise a short ID generation algorithm (can be anything, really)

2) Store a mapping from the short, generated ID to the long URL you want 
in a DB table somewhere.

3) Provide a controller that takes the short ID as a parameter, reads 
the DB table and issues a redirect to the long URL.

Now, unless you're on a GET access with plenty of arguments inline, 
Rails app URLs are usually darn short.

-- 
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to