Sha256: a0204b3a13cbbb9728db62150ef49286e30027ed4881ada6ecd32607b2ad3fd5

Contents?: true

Size: 397 Bytes

Versions: 2

Compression:

Stored size: 397 Bytes

Contents

module PolicyManager
  class JsonLink

    def self.render(collection = nil)
      ActionController::Base.helpers.content_tag(:a, "Open as JSON", href: link(collection), target: '_blank')
    end

    private

    def self.link(collection)
      if collection.nil? || collection.current_page == 1
        return "./data.json"
      else
        return "./../data.json"
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gdpr_rails-0.3.1 lib/policy_manager/exporter/json_link.rb
gdpr_rails-0.3.0 lib/policy_manager/exporter/json_link.rb