Method: Fe::ApplicationHelper#link_to_function

Defined in:
app/helpers/fe/application_helper.rb


48
49
50
51
52
53
54
55
56
# File 'app/helpers/fe/application_helper.rb', line 48

def link_to_function(name, *args, &block)
   html_options = args.extract_options!.symbolize_keys

   function = block_given? ? update_page(&block) : args[0] || ''
   onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function}; return false;"
   href = html_options[:href] || '#'

   (:a, name, html_options.merge(href: href, onclick: onclick))
end