Todd Huss wrote:
David, I understand that components are going out, but I still think they result in cleaner code than what you're proposing here and clean and easy to understand code is what rails is all about isn't it?
For example I personally find:
1. Extracting the set_cart out and then mixing it in to all controllers that need it, calling it via a before_filter, and then rendering a partial in all views that need it
It isn't complex to use the filters...
def ApplicationController private def set_cart @cart = end end
def CartController < ApplicationController before_filter :set_cart :only=>[:show]
def show end end
def CheckoutController < ApplicationController before_filter :set_cart :only=>[:confirm_order]
def confirm_order end end