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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I did hit this, so now just use:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.simple_form for={@form} action={~p"/"} &gt;
</code></pre>
<p>instead of</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;.form for={@form} action={Routes.home_path(@conn, :action, params)} &gt;
</code></pre>
<p>and the <code>:action</code> from verified_route is whatever you defined in the router for that path</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="285109" 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/preserve-params-when-push-patch-from-handle-event/47660/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-285109" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="285109"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
    <div class="postbit" id="285299" data-post-id="285299">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="orsinium" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/orsinium/120/26462_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  orsinium
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I see that people resurrected this thread with the release of Phoenix 1.7. So, probably, I should provide a final solution to it.</p>
<p>What I ended up doing is explicitly re-add search params to the new path when updating the page number:</p>
<p><a href="https://github.com/orsinium-labs/itj/blob/2a27e8bbe3d2a2a3702b8a1b9cce39622b0374e6/lib/itj_web/components/pagination.ex#L9-L12" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/orsinium-labs/itj/blob/2a27e8bbe3d2a2a3702b8a1b9cce39622b0374e6/lib/itj_web/components/pagination.ex#L9-L12</a></p>
<p>And I do not re-add the page number when the search is updated because I want to get the user to the first page when they change the parameters anyway.</p>
<p>So, this solution is a bit messy (because the pagination component must know about all other components that change the page parameters, which is a good example of bad coupling) and you should avoid doing that in big projects. That was good enough for a small pet project, though.</p>
<p>People here (<a class="mention" href="/u/cmo" rel="nofollow">@cmo</a> and <a class="mention" href="/u/sleepful" rel="nofollow">@Sleepful</a>) say that in Phoenix 1.7 verified routes should preserve GET parameters. I can’t check it right now (the project is still on Phoenix 1.6), so I’ll mark it as the answer. Feel free to drop a message in the thread if it doesn’t work 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="285299" 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/preserve-params-when-push-patch-from-handle-event/47660/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-285299" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="285299"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="317489" data-post-id="317489">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>That’s how I do it even now but I really wonder if there’s a better way now. That and I keep params in the assigns, but it feels dirty.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="317489" 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/preserve-params-when-push-patch-from-handle-event/47660/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-317489" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="317489"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>