I have a question of where I can find docs/resources related to what I think is ecto
's interpolation syntax. I was trying to find a contains
function or something similar for an ecto
query and found this gem in Stack Overflow.
|> where([p], like(p.title, ^"%#{String.replace(term, "%", "\\%")}%"))
I have tried to find the interpolation syntax for this, ^"%#{String.replace(term, "%", "\\%")}%")
, but can’t seem to find any cheat sheet for it. For example, why %
at the beginning and end? I have seen the %
at the beginning so I thought that meant begins with
or something.
Any recommendations would be appreciated. I plan on creating a doc or contributing back to Ecto if we can crowd source an answer here as well.