Example phoenix project using phoenix_inline_svg
rm -rf priv/static/svg/
mix deps.compile phoenix_inline_svg --force
mix phx.server
== Compilation error in file lib/phoenix_inline_svg_example_web/views/button_view.ex ==
** (CompileError) lib/phoenix_inline_svg_example_web/views/button_view.ex:9: undefined function svg_image/2
(elixir) src/elixir_locals.erl:98: :elixir_locals."-ensure_no_undefined_local/3-lc$^0/1-0-"/2
(elixir) src/elixir_locals.erl:99: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
(stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
(elixir) lib/kernel/parallel_compiler.ex:229: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7
This error can be resolved by copying over the svgs into /priv/static
cp -avr assets/static/svg priv/static
mix phx.server
To start your Phoenix server:
mix deps.get
mix ecto.setup
cd assets && npm install
mix phx.server
Now you can visit localhost:4000
from your browser.
Ready to run in production? Please check our deployment guides.