Skip to content
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

[FEATURE-REQUEST] Link from index to another resource #253

Open
bitboxer opened this issue Nov 21, 2022 · 2 comments
Open

[FEATURE-REQUEST] Link from index to another resource #253

bitboxer opened this issue Nov 21, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@bitboxer
Copy link

Describe the problem you're proposing to solve

I have belongs_to associations. In the index I show the name of that association, but I would love to also be able to click on that association name and open the form for that specific entry.

@bitboxer bitboxer added the enhancement New feature or request label Nov 21, 2022
@ghenry
Copy link
Collaborator

ghenry commented Apr 18, 2023

We're struggling at the moment. If you have any time to work on this, that would be much appreciated!

@jonklein
Copy link

I realize this is an old/stale issue, but for anybody looking for a solution/workaround, you can add something like this to your index:

[
  owner: %{value: fn p ->
    p = MyRepo.preload(:owner)
    Phoenix.HTML.raw("<a href='/admin/path/to/owners/#{p.owner_id}'><%= p.owner.name %></a>") 
  end}
]

You can of course customize the link location and text as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants