Ruby on Rails Caching And JavaScript Techniques

Cross posted from darthsid While implementing caching in a recent rails project I came across some typical caching issues. In a lot of pages the content is same for all users but certain components in them have user specific actions. As an example, I have a page listing all public messages that users have posted(similar to the public timeline in twitter) but actions on those messages are user specific(eg: only owner or admin can delete a message). Also, most of these actions use ajax and the rails authenticity token in them also gets cached resulting in subsequent failures if the session changes. Another issue was that the…

Two best online API/Rails API

Today I found two best API sites. One is http://www.gotapi.com.
This site provides APIs of almost all languages.
The other API site which is only focused on Rails is http://www.railsbrain.com/. I like this most. You can also download this API. It is AJAX based fast, useful.

Sample Rails Application – A demo for the ajax based drag drop tree in rubyonrails

I have provided the source code of the ajax based drag drop tree in rubyonrails in one of my previous posts.
I found some of the people are getting problems to incorporate the code into their running applications so i am providing a sample rails application in which all the code for tree is already been […]

Uploading files using AJAX

There is no way to upload files using AJAX. How Gmail does it then? Well, the answer is using <iframe>. Here is a post that describe this technique in detail. Infact we are using this technique from months, obviously inspired by Gmail. 😉
update: Technically speaking, it’s not Ajax. Just an iframe hack. You are […]