scinote-web/app/utilities/protocol_importers/protocol_description_builder.rb

17 lines
505 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module ProtocolImporters
class ProtocolDescriptionBuilder
def self.generate(protocol_json)
return '' unless protocol_json[:description]
html_string = ApplicationController
.renderer
.render(template: 'protocol_importers/templates/protocol_description',
layout: false,
assigns: { description: protocol_json[:description] })
html_string
end
end
end