ex_admin
ex_admin copied to clipboard
Incomplete documentation for Override the Actions Column (ExAdmin.Index)
On the ExAdmin.Index page under Override the Actions Column a macro or function named safe_concat is used to join the results of the link_to methods together. I couldn't find reference to this so I rolled my own. For reference, here's the version that I created:
defp safe_concat(list) do
list
|> Enum.map(fn x -> Phoenix.HTML.safe_to_string(x) end)
|> Enum.join
end
I placed this inside the module where I was redefining the action list, outside the register_resource macro definition.
Also, link_to must be qualified (i.e., Register.link_to instead of just link_to) as both ExAdmin.Register.link_to and ExAdmin.Utils.link_to are in scope within the module when using ExAdmin.Register as shown in the preceding examples.