Sha256: 3377bf3765dc188501bc3ed6cfcfc9bb5af4c62a11d84c1b782ef8ba8a6b2512

Contents?: true

Size: 578 Bytes

Versions: 10

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Letters
    # Note we cannot use a partial layout with render_to_string as it will always expect
    # the location to be in views/layouts and its not possible in Rails 5.1 to specify
    # another or absolute path
    class HtmlRenderer
      def call(letter)
        context = LettersController.new
        context.render_to_string_with_wicked_pdf(
          partial: "/renalware/letters/formatted_letters/letter",
          locals: { letter: letter },
          encoding: "UTF-8"
        )
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/letters/html_renderer.rb
renalware-core-2.1.0 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.167 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.166 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.165 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.164 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.163 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.162 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.161 app/models/renalware/letters/html_renderer.rb
renalware-core-2.0.160 app/models/renalware/letters/html_renderer.rb