Method: AgileFormFields::Comment#render

Defined in:
app/models/agile_form_fields/comment.rb

#renderObject

Render comment field html code



51
52
53
54
55
56
57
58
59
# File 'app/models/agile_form_fields/comment.rb', line 51

def render
  comment = @yaml['comment'] || @yaml['text']
  @yaml['html'] ||= {}
  @yaml['html']['class'] = 'ar-comment ' + @yaml['html']['class'].to_s
  html = @yaml['html'].map { |k, v| %( #{k}="#{v}") }.join

  @html += %(<div #{html}>#{t(comment, comment).gsub("\n",'<br>')}</div>)
  self
end