-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Field::BelongsTo > field.associated_resource_options seems to produce only id's for the key field #2382
Comments
nvm, I found it this snippet in the dashboard code:
I edited it like so:
And now it's working. |
Awesome discovery |
This is in the documentation, on the same page http://administrate-demo.herokuapp.com/customizing_dashboards (under "Defining labels" further below). However I understand how this can be difficult to find. In general writing documentation is difficult because not everything can be made discoverable, as there would be too much information and things would be hidden again. Having said that, do you have a suggestion as to how we could make this clearer? A PR would be fantastic. I'm closing this as it's documented, while we still would accept a contribution to improve it. |
What were you trying to do?
I was trying to display a list of associated items on a belongs_to element (post.rb, trying to display profile.rb)
the post belongs to the profile
What did you end up with (logs, or, even better, example apps are great!)?
field.associated_resource_options looks something like this:
[["Profile #2290", 2290], ["Profile #3719", 3719], ["Profile #3698", 3698], ["Profile #2786", 2786], ["Profile #2793", 2793], ["Profile #3815", 3815], ["Profile #2657", 2657], ["Profile #2834", 2834], ["Profile #2836", 2836], ["Profile #2105", 2105], ["Profile #3317", 3317], ["Profile #2287", 2287], ["Profile #4107", 4107], ["Profile #2289", 2289], ["Profile #2839", 2839], ["Profile #2097", 2097], ["Profile #2313", 2313], ["Profile #2304", 2304], ["Profile #3224", 3224], ["Profile #3756", 3756], ["Profile #3757", 3757], ["Profile #3828", 3828], ["Profile #2849", 2849], ["Profile #3547", 3547], ["Profile #3543", 3543], ["Profile #3548", 3548], ["Profile #3549", 3549], ["Profile #3550", 3550], ["Profile #3551", 3551], ["Profile #3552", 3552], ["Profile #4097", 4097], ["Profile #3544", 3544], ["Profile #3545", 3545], ["Profile #3546", 3546], ["Profile #2794", 2794], ["Profile #3090", 3090], ["Profile #2796", 2796], ["Profile #2821", 2821], ["Profile #2859", 2859], ["Profile #4098", 4098], ["Profile #3758", 3758], ["Profile #3759", 3759], ["Profile #3760", 3760], ["Profile #3762", 3762], ["Profile #2169", 2169], ["Profile #2869", 2869], ["Profile #2173", 2173], ["Profile #4044", 4044], ["Profile #2174", 2174], ["Profile #2321", 2321], ["Profile #2172", 2172], ["Profile #2878", 2878], ["Profile #3691", 3691], ["Profile #3692", 3692], ["Profile #3694", 3694], ["Profile #3695", 3695], ["Profile #3696", 3696], ["Profile #3697", 3697], ["Profile #3822", 3822], ["Profile #2175", 2175], ["Profile #2879", 2879], ["Profile #3092", 3092], ["Profile #2322", 2322], ["Profile #4099", 4099], ["Profile #2447", 2447], ["Profile #2882", 2882], ["Profile #3553", 3553], ["Profile #3556", 3556], ["Profile #3681", 3681]]
What versions are you running?
I just want to display a list of the profiles by their names. They do have a name attribute in their model.
From Post Dashboard:
this is my belongs_to/_form.html.erb:
The text was updated successfully, but these errors were encountered: