Search code examples
webpackelixirphoenix-frameworkumbrella

Phoenix.Router.NoRouteError for assets


in elixir i try to create project under umbrella with this command

mix phx.new my_project --umbrella

in apps directory try to install phoenix project with this command

mix phx.new phx_project --no-ecto

and trye to add assets with new structure under the assets directory and new file with bar.css and use it on front end with :

<%= Routes.static_path(@conn, "/ja/bee/foo/bar.css") %>

I got nothing found.

but with this

<%= Routes.static_path(@conn, "/css/app.css") %>

it's ok .


Solution

  • I tried to put my assets (js, css, images) under the assets directory but the real place, it is in fact under the assets/static directory. Personally I think this is not a good place why? Because in assets directory we have directories like css, js directory.