Module: ActionView::Helpers::JavaScriptHelper

Defined in:
lib/versatile_rjs/to_function_ext.rb

Instance Method Summary collapse

Instance Method Details

#_versatile_rjs_function_block_extraction(block) ⇒ Object



17
18
19
# File 'lib/versatile_rjs/to_function_ext.rb', line 17

def _versatile_rjs_function_block_extraction(block)
  VersatileRJS::Page.new(self).evaluate(&block).to_script.gsub(/[\r\n]+/, '')
end

#button_to_function_with_block(name, function = nil, html_options = {}, &block) ⇒ Object



5
6
7
8
9
# File 'lib/versatile_rjs/to_function_ext.rb', line 5

def button_to_function_with_block(name, function = nil, html_options={}, &block)
  function =
    _versatile_rjs_function_block_extraction(block) if block_given?
  button_to_function_without_block(name, function, html_options)
end


11
12
13
14
15
# File 'lib/versatile_rjs/to_function_ext.rb', line 11

def link_to_function_with_block(name, function = nil, html_options={}, &block)
  function =
    _versatile_rjs_function_block_extraction(block) if block_given?
  link_to_function_without_block(name, function, html_options)
end