lib/volt/page/bindings/view_binding/controller_handler.rb in volt-0.9.7.pre3 vs lib/volt/page/bindings/view_binding/controller_handler.rb in volt-0.9.7.pre5

- old
+ new

@@ -57,9 +57,17 @@ # before_action chain was not stopped false end + # If the controller wants to know, provide a general way the controller can + # know if its being removed. This lets us cleanup any watches. + def send_controller_removed! + if @controller.respond_to?(:controller_removed!) + @controller.controller_removed! + end + end + # Fetch the controller class def self.get_controller_and_action(controller_path) fail "Invalid controller path: #{controller_path.inspect}" unless controller_path && controller_path.size > 0 action = controller_path[-1]