lib/initjs/helper.rb in initjs-0.1.3 vs lib/initjs/helper.rb in initjs-1.0.0
- old
+ new
@@ -1,11 +1,12 @@
module Initjs
module Helper
- def initjs_tag
+ def initjs_tag options = {}
content_tag 'div', '', { :id => "init-js",
- :"data-controller-class" => controller.class.name,
- :"data-controller-name" => controller.controller_name.camelize,
- :"data-action" => controller.action_name.camelize }
+ :"data-controller-class" => controller.class.name,
+ :"data-controller-name" => controller.controller_name.camelize,
+ :"data-action" => controller.action_name.camelize,
+ :"data-app-name" => options[:app_name] || "App"}
end
end
end
ActionView::Base.send :include, Initjs::Helper