Sha256: 54b03e92cd047e905abbf6244ae8366c73bea7476e46ee43a8e75a06bcde111f

Contents?: true

Size: 632 Bytes

Versions: 7

Compression:

Stored size: 632 Bytes

Contents

module Ecm::Downloads
  module DownloadHelper
    def render_download(download_name, _options = {})
      download = Download.where(name: download_name).first.decorate
      if download.nil?
        I18n.t('ecm.downloads.download.messages.not_found', name: download_name)
      else
        begin
          o = Ecm::Downloads::Configuration.prevent_textile_rendering_in_html ? '<notextile>' : ''
          o << render(download)
          o << '</notextile>' if Ecm::Downloads::Configuration.prevent_textile_rendering_in_html
          return o.html_safe
        rescue => e
          raise e
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ecm_downloads2-5.0.1 app/helpers/ecm/downloads/download_helper.rb
ecm_downloads2-5.0.0 app/helpers/ecm/downloads/download_helper.rb
ecm_downloads2-4.0.1 app/helpers/ecm/downloads/download_helper.rb
ecm_downloads2-3.0.0 app/helpers/ecm/downloads/download_helper.rb
ecm_downloads2-2.0.3 app/helpers/ecm/downloads/download_helper.rb
ecm_downloads2-2.0.2 app/helpers/ecm/downloads/download_helper.rb
ecm_downloads2-2.0.0 app/helpers/ecm/downloads/download_helper.rb