module ActsAsExportable::ViewHelper
Public Instance Methods
link_to_export(*args)
click to toggle source
Download csv Link
Link_to_export “Link Text”, “Contact”, :id => “contact-button” <a href=“export/index?class_name=Contact” id=“contact-button”>Link Text</a>
# File lib/acts_as_exportable/view_helper.rb, line 12 def link_to_export(*args) name = args[0] class_name = args[1] options = args[1] || {} html_options = args[2] url = "export?class_name=#{class_name}" html_options = convert_options_to_data_attributes(options, html_options) tag_options = tag_options(html_options) href_attr = "href=\"#{url}\"" "<a #{href_attr}#{tag_options}>#{html_escape(name || url)}</a>".html_safe end