Closed nafster closed 1 year ago
Great that you found it!
I guess your solution kind of explains why it didn't work? The link_to_remove_association
searches for the nearest/closest surrounding wrapper_class
(default nested-fields
) and will remove it. However, probably, because of the float, the link was outside the nested-fields block, and so it was no longer found?
Hi! I've been using cocoon on many projects for several years and I love it!
I have a project working fine. link_to_remove_association and link_to_add_association work as expected, and all of the server side stuff works.
I would like to have the link_to_remove_association appear next to the field label. I have tried:
float-left
class usingrender_options
;style='float:left'
block using the same;.remove_fields {float: left !important;}
;float-left
class to the generated HTML (using Inspect).All of these methods make the link_to_remove_association appear as I want it, but also make the link stop working. Clicking on it does nothing, and shows nothing in the console.
Thanks!
EDIT: I found a workaround by wrapping
.nested-fields
with a.nested-fields-wrapper
, and putting thelink_to_remove_association
and.nested-fields
within that wrapper and changing thewrapper_class
option. That seems to work ok.Still curious if you have any idea why the previous way I described would make it stop working.