lib/compony/model_fields/association.rb in compony-0.0.5 vs lib/compony/model_fields/association.rb in compony-0.0.6
- old
+ new
@@ -30,11 +30,15 @@
int? local_schema_key, cast_str: true
end
end
end
- def simpleform_input(form, _component, **input_opts)
- return form.association @name, **input_opts
+ def simpleform_input(form, _component, name: nil, **input_opts)
+ return form.association name || @name, **input_opts
+ end
+
+ def simpleform_input_hidden(form, _component, name: nil, **input_opts)
+ return form.input name || @schema_key, as: :hidden, **input_opts
end
protected
# Uses Rails methods to figure out the arity, schema key etc. and store them.