0

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 .

Justin Wood
  • 9,941
  • 2
  • 33
  • 46
amir baqdadi
  • 174
  • 1
  • 1
  • 12

2 Answers2

1

In your endpoint.ex file, you will have a section that looks something like

  plug Plug.Static,
    at: "/", from: :attendance_web, gzip: false,
    only: ~w(css fonts images js favicon.ico robots.txt)

You will need to add the ja directory to the list in the :only key. Then make sure your ja directory is beside your css directory.

Justin Wood
  • 9,941
  • 2
  • 33
  • 46
0

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.

amir baqdadi
  • 174
  • 1
  • 1
  • 12