Functions in attributes
DerKobe opened this issue · 2 comments
DerKobe commented
I ran into a brick wall when I tried to get something like this to work:
%img{src: image(@current_user, 300)}
image/2
is defined in the view, but I always get the error undefined function image/0
.
It's no problem with plain values or functions/0. Btw something like this does also not work: %p{alt: @current_user.name}
. With this I get protocol Phoenix.HTML.Safe not implemented for %MyApp.User{__meta__: #Ecto.Schema.Metadata...
.
DerKobe commented
Ok, it is a Calliope thing and there it is known.
smpallen99 commented
Please use string interpolation. I just successfully tested the following on calliope v0.4.0.
%img{src: "#{image(@current_user, 300)}"}