Search code examples
ruby-on-railsajaxruby-on-rails-3rails-cells

RAILS: Tracking content with /#foo in the address bar


Just like in Gmail, I want to create a div which when loaded with ajax would output a #foo in the address bar to track what content would be loaded.

If you go to https://mail.google.com/mail/?shva=1#sent gmail, if signed in, will take you straight to your sent box.

I want to do the same. For example. I have a div that loads a list of recipes. Once a recipe on the list has been clicked content gets loaded from db in the same div and the address bar would say http://site.com/#recipe-permalink. If this link gets passed to a friend and the friend goes to http://site.com/#recipe-permalink the div would load appropriate content with that recipe.

Also is there a way to control more than one div? For example if url is http://site.com/#recipe-permalink#blue app would load recipe in one div and appropriate content in another div for #blue (what ever it may be).

Is there a way to make cells or apotomo have this functionality?

Are there any SEO concerns with doing this as well? Would the crawlers be able to pick up content through #foo links?


Solution

  • Probably not a full answer to your question but I believe this episode of railscasts would be interesting to you. http://railscasts.com/episodes/246-ajax-history-state