I'm questioning what appears to be a recommendation that makes no sense
in AWDWR 2nd Ed. I get the point being made, but the actual
convention/implementation seems to make the point ineffective.-- In the layout, we have access to the @cart instance variable that
was set by the controller. It turns out that this is also available
inside partials called from the layout. However, this is a bit like
calling a method and passing it some value in a global variable. It
works, but it's ugly coding, and it increases coupling (which in turn
makes your programs brittle and hard to maintain).
This is a good point. I don't recommend using instance variables in
partials. Everything should be passed to the partial from the
template. Treat a partial like a subroutine that can be called in
different contexts and that you pass arguments to.