<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="279501" data-post-id="279501">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="alaadahmed" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/alaadahmed/120/22965_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  alaadahmed
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I would hope the <code>controllers</code> folder structure to be more organized like <code>live</code>, <a href="https://forum.elixirforum.com/t/organise-files-under-controllers-folder-similar-to-live-and-context-folder/54136" class="inline-onebox" rel="nofollow">Organise files under *controllers* folder similar to *live* and context folder</a><br>
But ya, we still can do this manually after generating files.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279501" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-279501" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279501"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="279504" data-post-id="279504">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="shahryarjb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/shahryarjb/120/39485_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  shahryarjb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>When we are using <code>as</code> like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.simple_form for={%{}} as={:tag} phx-submit="save_tag" phx-change="validate_tag"&gt;
</code></pre>
<p>We should get it in our <code>handle_event</code> like this, okay?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def handle_event(
  "save_tag",
  {"tag" =&gt; %{"tag" =&gt; tag, "type" =&gt; type, "id" =&gt; id, "parent_id" =&gt; parent_id}},
  socket
) do
</code></pre>
<p>But I got:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def handle_event(
  "save_tag",
  %{"tag" =&gt; tag, "type" =&gt; type, "id" =&gt; id, "parent_id" =&gt; parent_id},
  socket
) do
</code></pre>
<p>Am I wrong in understanding <code>as</code> keyword?</p>
<blockquote>
<p>It should be noted, I updated my mix file to phoenix 1.7 and after that I copied the <code>core_components.ex</code> from a fresh phoenix 1.7 installed</p>
</blockquote>
<p>Other problem is, why we should pass value to <code>input</code>, when it is empty by default</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.input name="tag" label="Tag Name" id={"field-tag-#{@type}-#{@block_id}"} value=""/&gt;
</code></pre>
<p>without <code>value=""</code> I have error, I can edit the core component or create new one to have this, but I am curious why it should be like this, Something like this is my preference</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">attr :value, :any, default: nil   // or , default: ""
...
value={Phoenix.HTML.Form.normalize_value(@type, @value)}
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279504" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-279504" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279504"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="279514" data-post-id="279514">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="amym114" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/amym114/120/29679_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  amym114
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I see where you have a file in your directory structure, <code>live/home_live.ex</code>. Can you show us what the contents of it would look like?</p>
<p>Basically I want to know, in a project created with default settings, are you envisioning that it is utilizing the same template file as the controller-based view since everything uses function components now (and you could choose in your router whether to use a live or controller-based view), or does it have its own render or colocated template?</p>
<p>I’m assuming the latter, but I want to make sure I’m not overlooking anything. The generated live files follow the pattern you outlined above of having their own directory and Index module etc.  Thank you!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279514" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-279514" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279514"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="279524" data-post-id="279524">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The point of passing <code>as</code> is that you will use a form struct to generate the inputs for you with the correct names and values. Therefore, you must do this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.simple_form :let={f} for={%{}} as={:tag} phx-submit="save_tag" phx-change="validate_tag"&gt;
</code></pre>
<p>And then pass <code>field={f[:foo]}</code> to your input. Alternatively, call <code>to_form(%{}, as: :tag)</code> in your LiveView and pass the result of <code>to_form</code> as <code>for</code> and use <code>field={@form[...]}</code>. In other words, you must let <code>&lt;.input</code> generate the names for you.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279524" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-279524" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279524"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="279589" data-post-id="279589">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="28" data-topic="54113">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>Therefore, you must do this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.simple_form :let={f} for={%{}} as={:tag} phx-submit="save_tag" phx-change="validate_tag"&gt;
</code></pre>
<p>And then pass <code>field={f[:foo]}</code> to your input. Alternatively, call <code>to_form(%{}, as: :tag)</code> in your LiveView and pass the result of <code>to_form</code> as <code>for</code> and use <code>field={@form[...]}</code>. In other words, you must let <code>&lt;.input</code> generate the names for you.</p>
</blockquote>
</aside>
<p>I think this needs some better documentation or even warnings. I just ran into this as well updating a form to 1.7.0 and removing the <code>:let={f}</code> as per all the new documentation around using <code>@form</code>. It took me a solid while till I figured out why my <code>as="form"</code> was no longer working.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279589" data-batch-url="/posts/batch_likers">
                        7
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-279589" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279589"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="279594" data-post-id="279594">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Can you take a stab at a PR? In a nutshell, <code>as=...</code> works, but you need to capture the form with <code>:let</code>. Unfortunately, there is no way for the component to know at the moment a <code>:let</code> was given or not, so the best we can do is document. Perhaps the best way to go about this is to deprecate <code>as</code> in the long term.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279594" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-279594" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279594"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="279614" data-post-id="279614">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="aiwaiwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/aiwaiwa/120/30155_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  aiwaiwa
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>At least some of these prepositions are a bit ambiguous <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"><br>
Beginning with <code>for</code>, it is generally used for comprehensions so it hints naturally, hey, write this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.form :for={f &lt;- @form} phx-change="validate" phx-submit="save"&gt;
   &lt;.input field={f[:username]} type="text" /&gt;
</code></pre>
<p>instead of this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.form :let={f} for={@form} phx-change="validate" phx-submit="save"&gt;
   &lt;.input field={f[:username]} type="text" /&gt;
</code></pre>
<p>I guess the confusion is coming from using <code>:for</code> and an atom vs <code>for</code> as attribute, as they look so similar.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279614" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-279614" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279614"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
    <div class="postbit" id="279866" data-post-id="279866">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="DaAnalyst" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  DaAnalyst
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks <a class="mention" href="/u/chrismccord" rel="nofollow">@chrismccord</a> and others!</p>
<p>Streams and the LV form optimization: long awaited great stuff!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="279866" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-279866" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="279866"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="280368" data-post-id="280368">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="superchris" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/superchris/120/23484_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  superchris
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is there an option to skip tailwind when running phx.new?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="280368" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-280368" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="280368"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="280373" data-post-id="280373">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Eiji" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Eiji/120/36743_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Eiji
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>No, there’s no such option. Even with <code>--no-assets</code> in <code>core_components.ex</code> there are still <code>tailwind</code> classes.</p>
<p>If you want to see all <code>phx.new</code> task options call: <code>mix help phx.new</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="280373" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-7-0-final-is-out/54113/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-280373" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="280373"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/54113/load_more?page=4">Load more posts (11 remaining)</a>
</div></template></turbo-stream>