- value = value_from_params(model_class: model_class, property: property, type: type) - form_object = instance_variable_get "@#{object}_form" - if type.class.in? [ Symbol, String ] - 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]) - else = form.input property, as: type, label: false, input_html: { name: "#{object}[#{property}]", id: "#{object}_#{property}", value: (form_object.send(property) || form_object.model.send(property) || value) } - else - if type[:input_options] - options = type[:input_options] = form.label form_object.model.class.human_attribute_name property - case type[: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), **options - when :association = form.association property, **association_params(form_object: form_object, property: property, value: value, object: object), **options - 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]), **options - else = form.input property, as: type[:type].to_sym, label: false, input_html: { name: "#{object}[#{property}]", id: "#{object}_#{property}", value: (form_object.send(property) || form_object.model.send(property) || value) }, **options - else - property_value = form_object.model.values.present? && form_object.model.values[property.to_s] = render 'tramway/core/shared/input_extended', field: type[:extended_form_property], class_name: :record, value: property_value, f: form