Module: ActionView::Helpers::JavaScriptHelper

Included in:
Tags::CheckBox, Tags::Select, Tags::TextArea, Tags::TextField
Defined in:
lib/prime/rails/javascript_helper.rb

Instance Method Summary collapse

Instance Method Details

#p_javascript_tag(content_or_options_with_block = nil, html_options = {}, &block) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/prime/rails/javascript_helper.rb', line 2

def p_javascript_tag(content_or_options_with_block = nil, html_options = {}, &block)
  content =
    if block_given?
    html_options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash)
    capture(&block)
  else
    content_or_options_with_block
  end

  (:script, content.html_safe, html_options)
end