I have a group of categories and I access these categorizes via javascript several times during the average course of use for my application via JSON.
So in my control currently I have a
@categories = Category.all
respond_to do |format|
format.html # index.html.erb
format.json
along with the appropriate index.json.erb file that formats what I need as far as JSON.
Now I want to add some memcached functionality to this so in the index.json.erb file I have added
<% cache "JSON_CATEGORIES_ALL" do -%> block around my output
My question is how do I get my controller to call this cache key when responding to a JSON request and act normally, pulling from the database, on other calls?
Thanks