scinote-web/app/utilities/protocol_importers/protocol_description_builder.rb
2019-06-17 12:24:09 +02:00

16 lines
505 B
Ruby

# 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