module ActiveAdmin::ViewHelpers::DownloadFormatLinksHelper
Public Class Methods
included(base)
click to toggle source
# File lib/active_admin/view_helpers/download_format_links_helper.rb, line 27 def self.included base base.extend ClassMethods end
Public Instance Methods
build_download_format_links(formats = self.class.formats)
click to toggle source
# File lib/active_admin/view_helpers/download_format_links_helper.rb, line 17 def build_download_format_links(formats = self.class.formats) params = request.query_parameters.except :format, :commit div class: "download_links" do span I18n.t('active_admin.download') formats.each do |format| a format.upcase, href: url_for(params: params, format: format) end end end
build_download_formats(download_links)
click to toggle source
# File lib/active_admin/view_helpers/download_format_links_helper.rb, line 5 def build_download_formats(download_links) download_links = instance_exec(&download_links) if download_links.is_a?(Proc) if download_links.is_a?(Array) && !download_links.empty? download_links elsif download_links == false [] else self.class.formats end end