app/views/tramway/admin/shared/_input.html.haml in tramway-admin-1.18.4 vs app/views/tramway/admin/shared/_input.html.haml in tramway-admin-1.18.4.1
- old
+ new
@@ -4,11 +4,9 @@
- type = type.to_sym
= form.label form_object.model.class.human_attribute_name property
- case type
- when :default
= form.input property, label: false, input_html: { name: "#{object}[#{property}]", id: "#{object}_#{property}", value: (form_object.send(property) || form_object.model.send(property) || value) }, selected: (form_object.model.send(property) || value)
- - when :select
- = form.input property, label: false, input_html: { name: "#{object}[#{property}]", id: "#{object}_#{property}", value: form_object.send(property) }, selected: (form_object.send(property) || value), collection: form_object.send("#{property}_collection")
- when :association
= form.association property, **association_params(form_object: form_object, property: property, value: value, object: object)
- when :polymorphic_association
= form.input property, **polymorphic_association_params(object: object, form_object: form_object, property: property, value: value[:id])
= form.input "#{property}_type", input_html: { name: "#{object}[#{property}_type]", id: "#{object}_#{property}_type", value: (form_object.send(property) || form_object.model.send("#{property}_type") || value[:type]) }, selected: (form_object.model.send("#{property}_type") || value[:type])