smpallen99 / ex_admin

ExAdmin is an auto administration package for Elixir and the Phoenix Framework
MIT License
1.2k stars 272 forks source link

Incomplete documentation for Override the Actions Column (ExAdmin.Index) #256

Open frank-taylor-pcg opened 7 years ago

frank-taylor-pcg commented 7 years ago

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.

smpallen99 commented 7 years ago

@frank-taylor-pcg Thanks for reporting this. It doesn't surprise me that some of the examples are out of date. We should have tests for each of the given examples so we can catch these errors as the project evolves :) I'll take a look at this issue soon.