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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="wolfiton" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/120/15884_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  wolfiton
                    <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>Not working</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;table&gt;
&lt;%= for user &lt;- @users do %&gt;
&lt;tr&gt;
&lt;td&gt;&lt;%= render("user.html", users: @users) %&gt;&lt;/td&gt;
&lt;td&gt;&lt;%= link "View", to: Routes.user_path(@conn, :show, @users.id) %&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;% end %&gt;
&lt;/table&gt;
</code></pre>
<p>Error trace:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[info] GET /users/
[debug] Processing with RumblWeb.UserController.index/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 500 in 52ms
[error] #PID&lt;0.459.0&gt; running RumblWeb.Endpoint (connection #PID&lt;0.458.0&gt;, stream id 1) terminated
Server: localhost:4000 (http)
Request: GET /users/
** (exit) an exception was raised:
    ** (ArgumentError) assign @user not available in eex template.

Please make sure all proper assigns have been set. If this
is a child template, ensure assigns are given explicitly by
the parent template as they are not automatically forwarded.

Available assigns: [:users]

        (phoenix_html) lib/phoenix_html/engine.ex:133: Phoenix.HTML.Engine.fetch_assign!/2
        (rumbl) lib/rumbl_web/templates/user/user.html.eex:1: RumblWeb.UserView."user.html"/1
        (rumbl) lib/rumbl_web/templates/user/index.html.eex:4: anonymous fn/3 in RumblWeb.UserView."index.html"/1
        (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
        (rumbl) lib/rumbl_web/templates/user/index.html.eex:2: RumblWeb.UserView."index.html"/1
        (rumbl) lib/rumbl_web/templates/layout/app.html.eex:26: RumblWeb.LayoutView."app.html"/1
        (phoenix) lib/phoenix/view.ex:410: Phoenix.View.render_to_iodata/3
        (phoenix) lib/phoenix/controller.ex:729: Phoenix.Controller.__put_render__/5
        (phoenix) lib/phoenix/controller.ex:746: Phoenix.Controller.instrument_render_and_send/4
        (rumbl) lib/rumbl_web/controllers/user_controller.ex:1: RumblWeb.UserController.action/2
        (rumbl) lib/rumbl_web/controllers/user_controller.ex:1: RumblWeb.UserController.phoenix_controller_pipeline/2
        (phoenix) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2
        (rumbl) lib/rumbl_web/endpoint.ex:1: RumblWeb.Endpoint.plug_builder_call/2
        (rumbl) lib/plug/debugger.ex:122: RumblWeb.Endpoint."call (overridable 3)"/2
        (rumbl) lib/rumbl_web/endpoint.ex:1: RumblWeb.Endpoint.call/2
        (phoenix) lib/phoenix/endpoint/cowboy2_handler.ex:42: Phoenix.Endpoint.Cowboy2Handler.init/4
        (cowboy) /home/dan/Codes/rumbl/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
        (cowboy) /home/dan/Codes/rumbl/deps/cowboy/src/cowboy_stream_h.erl:320: :cowboy_stream_h.execute/3
        (cowboy) /home/dan/Codes/rumbl/deps/cowboy/src/cowboy_stream_h.erl:302: :cowboy_stream_h.request_process/3
        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

</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="158956" 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/programming-phoenix-chapter-3-controllers-page-54/28337/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-158956" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="158956"
                     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 #11"></div>
  </section>
</div>
    <div class="postbit" id="158957" data-post-id="158957">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>And we are back to singular vs plural.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="158957" 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/programming-phoenix-chapter-3-controllers-page-54/28337/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-158957" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="158957"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="158958" data-post-id="158958">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="wolfiton" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/120/15884_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  wolfiton
                    <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>The index works now like this</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;table&gt;
  &lt;%= for user &lt;- @users do %&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;%= render("user.html", user: user) %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link "View", to: Routes.user_path(@conn, :show, user.id) %&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;% end %&gt;
&lt;/table&gt;

</code></pre>
<p>The show doesn’t work</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;h1&gt;Showing User&lt;/h1&gt;

&lt;%= render "user.html", user: @user %&gt;
</code></pre>
<p>Error trace:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[info] GET /users/1
[debug] Processing with RumblWeb.UserController.show/2
  Parameters: %{"id" =&gt; "1"}
  Pipelines: [:browser]
[info] Sent 500 in 26ms
[error] #PID&lt;0.548.0&gt; running RumblWeb.Endpoint (connection #PID&lt;0.547.0&gt;, stream id 1) terminated
Server: localhost:4000 (http)
Request: GET /users/1
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in RumblWeb.UserView.first_name/1
        (rumbl) lib/rumbl_web/views/user_view.ex:6: RumblWeb.UserView.first_name(nil)
        (rumbl) lib/rumbl_web/templates/user/user.html.eex:1: RumblWeb.UserView."user.html"/1
        (rumbl) lib/rumbl_web/templates/user/show.html.eex:2: RumblWeb.UserView."show.html"/1
        (rumbl) lib/rumbl_web/templates/layout/app.html.eex:26: RumblWeb.LayoutView."app.html"/1
        (phoenix) lib/phoenix/view.ex:410: Phoenix.View.render_to_iodata/3
        (phoenix) lib/phoenix/controller.ex:729: Phoenix.Controller.__put_render__/5
        (phoenix) lib/phoenix/controller.ex:746: Phoenix.Controller.instrument_render_and_send/4
        (rumbl) lib/rumbl_web/controllers/user_controller.ex:1: RumblWeb.UserController.action/2
        (rumbl) lib/rumbl_web/controllers/user_controller.ex:1: RumblWeb.UserController.phoenix_controller_pipeline/2
        (phoenix) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2
        (rumbl) lib/rumbl_web/endpoint.ex:1: RumblWeb.Endpoint.plug_builder_call/2
        (rumbl) lib/plug/debugger.ex:122: RumblWeb.Endpoint."call (overridable 3)"/2
        (rumbl) lib/rumbl_web/endpoint.ex:1: RumblWeb.Endpoint.call/2
        (phoenix) lib/phoenix/endpoint/cowboy2_handler.ex:42: Phoenix.Endpoint.Cowboy2Handler.init/4
        (cowboy) /home/dan/Codes/rumbl/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
        (cowboy) /home/dan/Codes/rumbl/deps/cowboy/src/cowboy_stream_h.erl:320: :cowboy_stream_h.execute/3
        (cowboy) /home/dan/Codes/rumbl/deps/cowboy/src/cowboy_stream_h.erl:302: :cowboy_stream_h.request_process/3
        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

</code></pre>
<p>Why does this not match <code>RumblWeb.UserView.first_name/1</code>from the view?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="158958" 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/programming-phoenix-chapter-3-controllers-page-54/28337/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-158958" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="158958"
                     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 #13"></div>
  </section>
</div>
    <div class="postbit" id="158961" data-post-id="158961">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="wolfiton" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/120/15884_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  wolfiton
                    <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>Thanks <a class="mention" href="/u/nobbz" rel="nofollow">@NobbZ</a></p>
<p>Had some problems in the context</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Rumbl.Accounts do
  @moduledoc """
  The Accounts context.
  """

  alias Rumbl.Accounts.User 

  def list_users do
    [
      %User{id: "1", name: "José", username: "josevalim"},
      %User{id: "2", name: "Bruce", username: "redrapids"},
      %User{id: "3", name: "Chris", username: "chrismccord"}
    ]
  end

  def get_user(id) do
    Enum.find(list_users(), fn map -&gt; map.id == id end)
  end

  def get_user_by(params) do
    Enum.find(list_users(), fn map -&gt;
      Enum.all?(params, fn {key, val} -&gt; Map.get(map, key) == val end)
    end)
  end
end

</code></pre>
<p>Works now</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="158961" 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/programming-phoenix-chapter-3-controllers-page-54/28337/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-158961" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="158961"
                     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>