Sha256: 880da6b6ab623f8e6fd25cd0fa3e76058adb4bda7c3d5e5170fd92922c435ded
Contents?: true
Size: 889 Bytes
Versions: 8
Compression:
Stored size: 889 Bytes
Contents
%div{ class: "form-group#{model.errors[field] ? ' has-error' : ''}" } %label.col-sm-3.control-label{ for: attributes[:id] }= label .col-sm-9 - type = attributes.delete(:type) - if type == 'select' - options = attributes.delete(:options) %select{attributes} - if attributes[:multiple] - options.each do |k,v| k ||= v; v ||= k; %option{ value: k, selected: (model.send(field).map(&:id).include? k)}= v - else %option{ value: ""} -- Select One -- - options.each do |k,v| k ||= v; v ||= k; %option{ value: k, selected: (k.to_s == model[field].to_s)}= v - elsif type == 'textarea' %textarea{attributes} = model[field] - else %input{attributes, type: type, value: model[field]} - if model.errors[field] %p.help-block.text-danger= model.errors[field].join(', ')
Version data entries
8 entries across 8 versions & 1 rubygems