Module: LinkToFunctionHelper
- Defined in:
- lib/link_to_function_helper.rb
Instance Method Summary collapse
-
#link_to_function(name, *args, &block) ⇒ Object
Puts the link_to_function back in a non-UJS way.
Instance Method Details
#link_to_function(name, *args, &block) ⇒ Object
Puts the link_to_function back in a non-UJS way. Handy if you’re trying to save time doing a Rails 3 upgrade.
3 4 5 6 7 8 9 10 11 |
# File 'lib/link_to_function_helper.rb', line 3 def link_to_function(name, *args, &block) = args..symbolize_keys function = block_given? ? update_page(&block) : args[0] || '' onclick = "#{"#{[:onclick]}; " if [:onclick]}#{function}; return false;" href = [:href] || '#' content_tag(:a, name, .merge(:href => href, :onclick => onclick)) end |