Module: ButtonLinkTo::Helper

Defined in:
lib/button_link_to/helper.rb

Instance Method Summary collapse

Instance Method Details



4
5
6
7
8
9
10
11
12
13
# File 'lib/button_link_to/helper.rb', line 4

def button_link_to(name = nil, options = nil, html_options = nil, &block)
  html_options, options = options, name if block_given?
  options ||= {}
  html_options = convert_options_to_data_attributes(options, html_options)
  url = url_for(options)

  html_options.merge!({"data-url" => url, :type => "button"})

  (:button, name || url, html_options, &block)
end