Sha256: 2aeb617b35685ce2e99c49c4d48733a238444d5aa80df8c95fd4675514f4d62e

Contents?: true

Size: 663 Bytes

Versions: 7

Compression:

Stored size: 663 Bytes

Contents

module Cmor
  module Files
    # Example:
    #
    #     # app/controllers/application_controller.rb
    #     class ApplicationController < ActionController::Base
    #       view_helper Cmor::Files::ApplicationViewHelper, as: :files_helper
    #     end
    #
    class ApplicationViewHelper < Rao::ViewHelper::Base
      # Example:
      #
      #     # app/views/layouts/application.html.haml
      #     = files_helper(self).render_download(name: 'Quick reference manual')
      #
      def render_file(identifier:)
        resource = Cmor::Files::FileDetail.where(identifier: identifier).first
        render resource: resource
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cmor_files-0.0.53.pre app/view_helpers/cmor/files/application_view_helper.rb
cmor_files-0.0.52.pre app/view_helpers/cmor/files/application_view_helper.rb
cmor_files-0.0.51.pre app/view_helpers/cmor/files/application_view_helper.rb
cmor_files-0.0.50.pre app/view_helpers/cmor/files/application_view_helper.rb
cmor_files-0.0.49.pre app/view_helpers/cmor/files/application_view_helper.rb
cmor_files-0.0.48.pre app/view_helpers/cmor/files/application_view_helper.rb
cmor_files-0.0.45.pre app/view_helpers/cmor/files/application_view_helper.rb