Dmitry Shvetsov
1 min readFeb 14, 2017

--

Thanks, D Y.

> I appreciate you sharing an alternative approach but your first example is much more confusing to me. The “show” action will either render a response or redirect but you need to look at “customer_special_offer_code” to see there’s a redirect.

Good point indeed. This definitely makes the code more indirect. Perhaps a more appropriate name for the block method will solve the problem.

> You mention not wanting to make a second request for the same data but you don’t have to if you memoize it.

Yes, you can do that, but all templates and worse partials will have access to this instance variable. I prefer to render templates and partials with locals.

--

--

Dmitry Shvetsov
Dmitry Shvetsov

Responses (1)