Module: Initjs::Helper
- Defined in:
- lib/initjs/helper.rb
Instance Method Summary collapse
Instance Method Details
#initjs_tag(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/initjs/helper.rb', line 3 def initjs_tag = {} = { app_name: } unless .is_a?(Hash) if [:partial] && [:partial] == true id = 'init-partial-js' else id = 'init-js' end content_tag 'div', '', { id: id, :"data-resource" => controller.controller_path.split('/').map(&:camelize).join('/'), :"data-action" => controller.action_name.camelize, :"data-app-name" => [:app_name] || "App"} end |