Add a InlineBelongsTo field #405
rakso-startkoden
started this conversation in
Ideas
Replies: 1 comment
-
I guess essentially I would like something like this to be possible:
Which I guess would require some kind of mix with code from HasManyThrough to render the child field as correct components? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I was converting my existing admin to using Backpex and I have cases in my apps that i think is quite common and should be considered.
I have a Schema "A" with a belongs_to to schema "B". But I don't want to have a entire live resource for B since its only ever used in association with A. Which means that I usually just have cast_assoc on schema a and use inputs_for for the nested changeset of B while editing A.
From looking in the source this would be a mix between the InlindeCrud, BelongsTo and the HasManyThrough field currently defined in Backpex. It could behave in a very similar manner in the forms as the HasManyThrough with the modal, or simply have them embedded in some kind of nested box inside the form.
I always think that screenshots for context is helpful so here is an example from my current admin where Schema Service has a belongs_to to a schema called Presentation page, which is in a separate schema because its not always needed in the context of services but still unique for a specific service.
I tried making my own based on the existing field modules. And could modify the inlinecrud to not expect a list of assocs but a single one instead, but was unable to get the rendering of field modules and not only text field working properly.
Beta Was this translation helpful? Give feedback.
All reactions