I have a controller class
class MyController < ApplicationController
def firstMethod
@obj = #get friends list from FB
end
def secondMethod
puts @obj
end
end
So in /my/firstMethod , i have
<%= link_to "Likes","/my/secondMethod" %>
The method is called and page is rendered but "puts @obj" display blank.
I know one way is to use before_filter but since its a expensive operation i want to get list of friends only once.
Any pointers ?
Harshit
@@obj), but unless you have verified by profiling that this is a performance bottleneck, you should stick with a before_filter. Also, Rails has caching, which allows you to cache a lot more than your friends list. Also note that in development mode, your controllers are reloaded at every request, so you can only use@@objas a cache