Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify non-existent field for combobox #28

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
6 changes: 5 additions & 1 deletion app/presenters/hotwire_combobox/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ def hidden_field_data
end

def hidden_field_value
form&.object&.public_send(name) || value
pranavbabu marked this conversation as resolved.
Show resolved Hide resolved
if form&.object&.respond_to?(name)
form.object.public_send(name)
else
value
end
end


Expand Down