Skip to content

Instantly share code, notes, and snippets.

@adambeynon
Created February 15, 2014 20:55
Show Gist options
  • Save adambeynon/9025110 to your computer and use it in GitHub Desktop.
Save adambeynon/9025110 to your computer and use it in GitHub Desktop.

The idea is that we are binding an attribute cart_empty on the current object to get updated when some remote attribute on some other object changes. This results in a method call current_obj.cart_empty = new_value.

bind(:cart_empty).to observe(@cart, :empty?)

bind(:cart_empty).to @cart.observe(:empty?)

bind :cart_empty, @cart.observe(:empty?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment