Skip to content

Instantly share code, notes, and snippets.

@zevarito
Created August 6, 2013 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zevarito/6164465 to your computer and use it in GitHub Desktop.
Save zevarito/6164465 to your computer and use it in GitHub Desktop.
# Controller
has_widgets do |root|
root << widget("cart/wizard", :cart_wizard, :display, purchase_order: @purchase_order)
end
# Cart Wizard Widget
after_initialize :setup!
def setup!(*)
@purchase_order ||= options.fetch(:purchase_order, nil)
end
has_widgets do
self << widget("cart/list", :cart_list, purchase_order: @purchase_order)
self << widget("cart/resume", :cart_resume)
self << widget("shipping/form", :shipping_form)
self << widget("payment/form", :payment_form)
self << widget("authentication")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment