I am running Ruby on Rails 3.1. I would like to know a practice/technique "commonly" used to set a variable (for example, status = 'loaded'
) in a partilal template file so to not repeat the variable setting any time that that partial template is rendered. That is, I have a partial template file that is rendered a lot of times in the same request and I would like to display a warning message in the log only one time (that is, a single time) even if the partial template is loaded more than once... for performance reasons (or for "perfectionism"...).
In few words, I would like to display only one time a "Warning" message in the log file.
How can I (easily) do that?