Skip to content
Discussion options

You must be logged in to vote

Thanks @pehbehbeh for the workaround.

Here is the code I came up with. The render function receives the assigns and the assigns store the item that is the struct.

      url: %{
        module: Backpex.Fields.URL,
        label: "URL",
        except: [:edit, :new],
        render: fn assigns ->
          ~H"""
          <span>
            <.link navigate={~p"/tenants/#{@item}"} class="link">{~p"/tenants/#{@item}"}</.link>
          </span>
          """
        end,

It still feels hacky as I have to specify a module that is not used in my case. I also had to wrap the link component into an html tag. Without that wrapper, I received the following error: Stateful components must have a sin…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pehbehbeh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants