Rick Bradley a écrit :
>>I'm wondering if there is a simple solution to call a method once per
>>page request.
>>
> Seems like a before_filter should be sufficient, simply
> 
> def my_method
>   return true if @@my_method_called
>   @@my_method_called = true
>   # do something
> end

Sure it would work. Is it a good practice to use a global for such a
problem ? Seems like a smart hack to me ;-)

-- 
Jean-Christophe Michel
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to