Closed supercodepoet closed 5 years ago
I'm pretty sure you're doing everything correct and it's just an unfortunate limitation right now in JaSerializer. For the time being you have two options:
attributes([
:id,
:label_alias
])
def label_alias(model, _conn), do: model.label
or use the attributes/2 callback.
excellent!!! That worked perfectly. Thanks for the help!
After upgrading to 0.13 from 0.12 my serializer views don't compile. I have a struct that has a label attribute:
when trying to compile I get:
imported Phoenix.HTML.Form.label/2 conflicts with local function
In Phoenix the :view has a
use Phoenix.HTML
which will import all the HTML functions for use in templates. This collision does not happen on v0.12.Is there something I should do that I am missing?