Sha256: 6c584ba2537a9608c74677af5a958a792e35ab59f9d1bfed59f76109985cec93
Contents?: true
Size: 768 Bytes
Versions: 71
Compression:
Stored size: 768 Bytes
Contents
module Volt class TextareaScope < ViewScope def initialize(handler, path, attributes) super(handler, path) @attributes = attributes end def add_binding(content) @html << "{{#{content}}}" end def close_scope(pop = true) # Remove from the scope @handler.scope.pop attributes = @attributes if @html[/\{\{[^\}]+\}\}/] # If the html inside the textarea has a binding, process it as # a value attribute. attributes['value'] = @html @html = '' end # Normal tag attributes = @handler.last.process_attributes('textarea', attributes) @handler.last.html << "<textarea#{attribute_string(attributes)}>#{@html}</textarea>" end end end
Version data entries
71 entries across 71 versions & 1 rubygems