It seems like it should be possible to pass in a conditional in place of the true/false that "read_only" is expecting for a field, however that doesn't seem to work. Is there a way to do a conditional read_only on a field based on that field's value?
Things I've tried that don't seem to work:
Pass a block:
field :user, :belongs_to_association do
help "Required. Can't be changed after creation."
read_only do
bindings[:object].user_id.present?
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With