Adding 2 form.html in the same model

I currently made 2 forms.

in the same template

lib/project_web/templates/test/form.html.eex
lib/project_web/templates/test/form2.html.eex

And inside my

lib/project_web/templates/test/new.html.eex

I added these buttons,

<a href="#test1" class="btn btn-info" data-toggle="collapse">Buttom 1</a>
<a href="#test2" class="btn btn-info" data-toggle="collapse">Buttom 2</a>

				<div id="test1" class="collapse">
                <%= render "form.html", Map.put(assigns, :action, Routes.test_path(@conn, :create)) %>
                </div>
				<div id="test2" class="collapse">
                <%= render "form2.html", Map.put(assigns, :action, Routes.test_path(@conn, :create)) %>
                </div>

Could you tell me why he doesn’t recognize the form named form2.html?

Is there an easier way to do this?

Do you get an error or does it just not print anything? Multiple renders shouldn’t be a problem in itself

It prints nothing.
I noticed that it doesn’t allow 2 form.

However, I don’t know how he will recognize the direct href.

What happens if you remove the 2 on the second one so you just try to print the first one twice?

I can see normally by removing a form

I mean try this

<div>
<%= render "form.html", Map.put(assigns, :action, Routes.test_path(@conn, :create)) %>
<%= render "form.html", Map.put(assigns, :action, Routes.test_path(@conn, :create)) %>
</div>

When you say it doesn’t print anything do you mean literally a blank page or it just doesn’t print the second form? There is no errors in the server logs?

I mean it doesn’t print the second form.

form2.html

For example

When I put it that way,
it doesn’t work form 2


<a href="#test1" class="btn btn-info" data-toggle="collapse">Buttom 1</a>
<a href="#test2" class="btn btn-info" data-toggle="collapse">Buttom 2</a>

				<div id="test1" class="collapse">
                <%= render "form.html", Map.put(assigns, :action, Routes.test_path(@conn, :create)) %>
                </div>
				<div id="test2" class="collapse">
                <%= render "form2.html", Map.put(assigns, :action, Routes.test_path(@conn, :create)) %>
                </div>

But when I put it like this, it works normally


<a href="#test1" class="btn btn-info" data-toggle="collapse">Buttom 1</a>
<a href="#test2" class="btn btn-info" data-toggle="collapse">Buttom 2</a>


				<div id="test2" class="collapse">
                <%= render "form2.html", Map.put(assigns, :action, Routes.test_path(@conn, :create)) %>
                </div>

Ok cool. It should work so it must be something else.

Get rid of the divs.
Still not working, then try doubling up the first render.
If that works try doubling up the second.

And can you paste the server logs for the request too please if none of those work?