Question about CRUD addField value in Admin Panel #872
Replies: 1 comment 4 replies
-
Hello @wellyngtonlourenco I think that's due to the fact you are forcing the field to be a text field. In that case, since you are forcing it to "not be a relationship", it's just displaying the plain value "as text". You can either Let me know if that helps. Cheers |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone!
I'm facing an issue in my admin panel setup, and I'd appreciate some guidance.
Setup:
Context:
I have a
User
model that is related (hasOne
) to two types (BelongsTo
), namelyClientInfo
andEmployeeInfo
. For simplicity, I'll focus onClientInfo
. My goal is to have the update page forClientInfo
fill the fields with the relatedUser
data.Here's a snippet of my code:
User Model:
ClientInfo Model:
ClientInfoCrudController:
Question:
Without my workaround, the ID of the
User
is displayed, so my workaround involves manually setting the value for the text field to avoid displaying theUser
ID. Is this approach correct? The goal is to achieve functionality similar to theaddColumns
setup, which correctly shows related user names.Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions