views:

151

answers:

2

RoR application can generate URL such as /post/10. But now I want to create a site, which works with URI-fragments like gmail.

For example gmail uses the following URLs https://mail.google.com/mail/?shva=1#sent https://mail.google.com/mail/?shva=1#label/books

I need to generate URL such as /#/post/10, where controller = "post", action = "show", id = "10".

Of course it will be good to use standard url-helpers.

A: 

The URI fragment is not sent to the server but only for local purpose. So you would need a client side language like JavaScript to parse the fragment and retrieve the resource.

Gumbo
Is any ready solution for RoR to create URI-fragmented RIA? May be plugins or gems?
Alexei
@Alexei: Sorry, actually I’m not that familiar with Ruby on Rails or Ruby.
Gumbo
A: 

According to this question everything after # is not sent to server. And if you want to handle somethink after # then you should use js (as @Gumbo said).

If you want to create complicated routes you can use route globbing - so this is the way to handle complicated url on server side. But if you want to generate urls you can write your own helpers. Url is nothing more than simple string.

klew