ariandanim

ariandanim

How to set up subfolder in MyApplib?

Dear all,

I try to figured out does Phoenix support subfolder → subfolder in folder lib such as :
lib
→ myapp_web
→ controller
→ subfolder (for controller and html.ex)
→ page_controller.ex
→ page_html.ex
→ subfolder (for html)
→ home.html.heex

I try this but showing error message, perhaps someone could help the right way. Tks

Marked As Solved

ariandanim

ariandanim

it’s solved,
my fault, just revise code in product_html.ex in :

embed_templates “../../frontend/product_html/*”

Also Liked

LostKobrakai

LostKobrakai

You want to post that here as well.

Generally elixir and phoenix do not care how you organize your files, but in phoenix certain features mostly around templates need to require knowledge around where related files are stored. Those might require change in configuration when you move them around.

hauleth

hauleth

I am pretty sure, that embed_templates do not find your frontend directory (because how it would guess where to look). It either needs to be sibling directory of blog_html.ex or you need to specify full relative path (aka ../frontend).

hauleth

hauleth

embed_templates "../frontend/*"

Last Post!

ariandanim

ariandanim

Tks Brother @sodapopcan the code you share i put additional like this

embed_templates “…/…/frontend/product_html/*”

Where Next?

Popular in Questions Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New

Other popular topics Top

dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

We're in Beta

About us Mission Statement