Sha256: 2bdd8a15b178b46b2a1dd577de67cba601bc3d7bdff35751b899bc78983e7335
Contents?: true
Size: 642 Bytes
Versions: 11
Compression:
Stored size: 642 Bytes
Contents
module AdminIt module Helpers class Input < WrapIt::Base html_class 'form-control' attr_accessor :field, :entity option :field, :entity argument :field, if: AdminIt::Field before_capture do html_attr[:type] = 'text' if field.is_a?(AdminIt::Field) context = @template.context resource = context.resource entity ||= context.entity html_attr[:name] = "#{resource.name}[#{field.name}]" html_attr[:id] = "#{resource.name}_#{field.name}" html_attr[:value] = field.render(entity, instance: self) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems