class Interview::TextAttribute

Attributes

cut[RW]
line_break[RW]
rows[RW]

Protected Instance Methods

build_read(b) click to toggle source
# File lib/interview/controls/text_attribute.rb, line 8
def build_read(b)
  return if value.nil?
  line_break = @line_break || true
  
  value = self.value.gsub(/\n/, '<br/>') if line_break
  value = value[0..29] + '...' if @cut and value.size > 30
  b << value.html_safe
end
build_write(b) click to toggle source
# File lib/interview/controls/text_attribute.rb, line 17
def build_write(b)
  rows = @rows || 8
  b << form_builder.text_area(@method, class: 'form-control', rows: rows)
end