I would combine what you did and pass the variables with “locals” but still memoize with an…

> Just curious, what is your aversion to instance variables?

They become available everywhere in templates, layouts, and partials, it can cause problems with complex or and nested templates. @not_assigned_ivar returns nil, “locals” tell you that they are not assigned. This is two main reasons why I trying to avoid using instance variables to pass data into views templates.

Don’t get me wrong this is just the case for Rails controllers and templates, memoization is the great technique.

> It’s two different unrelated responsibilities. I think that’s why I dislike it so much.

Absolutely agree with your thought here. I will think about it.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.