I'm trying to use the bbmustache package with Elixir. Adapting the documentation from Erlang to Elixir I tried multiple calls but none seems to be working.
:bbmustache.render("name: {{name}}", %{"name" => "hoge"})
# => "name: "
:bbmustache.render("name: {{name}}", %{name: "hoge"})
# => "name: "
:bbmustache.render("name: {{name}}", [{:name, "hoge"}])
# => "name: "
:bbmustache.render("name: {{name}}", [{"name", "hoge"}])
# => "name: "
There is probably something I don't get yet about strings and binaries or something else.
If anyone knows how to make it work that'd be awesome :-)
Thanks!
bbmustache seems to require the key of the Map or List of tuples to be char lists. This works:
iex(1)> :bbmustache.render("name: {{name}}", %{'name' => "hoge"})
"name: hoge"
Also render/3 you could pass the type of the keys.
iex(1)> :bbmustache.render("name: {{name}}", %{"name" => "hoge"}, [key_type: :binary])
"name: hoge"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With