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
belongs_to form issue #3828
Comments
@navjeetc this is the reason: #4298 (comment) |
That's can't be the reason. |
@navjeetc is this still a issue for you? |
@timoschilling they're saying that the ID is showing up, and the don't want it to show up. So it's the reverse of #4298 (comment) |
so looks like we should implement own content_columns that works better for our needs |
created ticket in formtastic repo for tracking |
There is a solution now. Not sure if we need to create PR for this untill get answer from formtastic mantainers.
ActiveAdmin::FormBuilder.class_eval do
def default_columns_for_object
assoc_columns = association_columns(:belongs_to)
cnt_columns = content_columns
klass = @object.class
# remove custom foreign keys from content columns to prevent duplicated inputs
if assoc_columns.present?
cnt_columns -= klass.reflections.map {|_,v| v.options[:foreign_key] }.compact
end
cols = asooc_columns + cnt_columns
cols -= Formtastic::FormBuilder.skipped_columns
cols.compact
end
end I will track it until formtastic provide more elegant way to fix this |
@timoschilling , formtastic guys tell they will accept PR for v 4.0. |
fixed by formtastic/formtastic#1241 |
I have a model
With this code in Active Admin edit form, it shows both two dropdowns for Organizations as well as two additional text fields for disclosed_from_orid and disclosed_to_orid and no matter. How to hide showing id fields. With this no matter what I choose in dropdown, it sets the org ids in consent model to the values in text fields.
The text was updated successfully, but these errors were encountered: