Sha256: 230fbc6de6c3e211e0b3ce3fc1e7175367a28ff6fb60913e0ad7036cecbbe726
Contents?: true
Size: 875 Bytes
Versions: 11
Compression:
Stored size: 875 Bytes
Contents
module Puffer module Inputs class Base attr_accessor :builder, :template, :field def initialize builder, template, field @builder = builder @field = field @template = template end def render html.html_safe end def html <<-INPUT <div class="label"> #{label} <div class="field_error"> #{error} </div> </div> #{input} INPUT end def label builder.label field end def input builder.text_field field, field.input_options end def error builder.object.errors[field.name.to_sym].first end def method_missing method, *args, &block template.send method, *args, &block if template.respond_to? method end end end end
Version data entries
11 entries across 11 versions & 1 rubygems