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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Anyway this question is not about <code>--no-schema</code> flag. It is more about scoping. Now I have about 50 schemas connected to database and about 20 embedded schemas for forms. And how I working on it:</p>
<ol>
<li>create schema</li>
<li>generate controller for web ui in main scope: <code>Proj.OrderController</code></li>
<li>generate controller for admin ui: <code>Proj.Admin.OrderController</code></li>
<li>generate controller for API: <code>Proj.API.OrderController</code></li>
</ol>
<p>So I have this separation but <code>models/*</code> looks messy now. And idea of per-context separations looks great for me. I am come from Django where re-usable apps is used and each have it’s own schemas, controllers (views in terms of django), templates, related code, etc.</p>
<p>But I am not sure how to split this code now. If I will have <code>Admin</code> context with all this models - I will end with same schemas mess. Should I have nested contexts like <code>lib/admin/orders/product.ex</code> then?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="25994" 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-v1-3-0-rc-0-released/3947/42">Post #41</a>
	                </div>
	            </div>
              <div id="likers-container-25994" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="25994"
                     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 #41"></div>
  </section>
</div>
    <div class="postbit" id="26003" data-post-id="26003">
  <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">
								<aside class="quote no-group" data-username="ssbb" data-post="42" data-topic="3947">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ssbb/48/4414_2.png" class="avatar"> ssbb:</div>
<blockquote>
<p>create schema<br>
generate controller for web ui in main scope: Proj.OrderController<br>
generate controller for admin ui: Proj.Admin.OrderController<br>
generate controller for API: Proj.API.OrderController</p>
</blockquote>
</aside>
<p>This looks great. I would say the only change you need is that instead of creating a schema, you will now create a context. It is likely that you want all of those controllers to consume from the same context and it is OK to add functions to the context that is needed for just one of those controllers.</p>
<p>The context is module and functions that are meant to satisfy the needs of your “web” context and other contexts. That’s it. There is no guideline that you need a context per controller, a context per namespace and what not. That’s exactly what we want to avoid.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26003" 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-v1-3-0-rc-0-released/3947/43">Post #42</a>
	                </div>
	            </div>
              <div id="likers-container-26003" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26003"
                     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 #42"></div>
  </section>
</div>
    <div class="postbit" id="26004" data-post-id="26004">
  <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">
								<aside class="quote no-group" data-username="mischov" data-post="39" data-topic="3947">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mischov/48/2489_2.png" class="avatar"> mischov:</div>
<blockquote>
<p>Is this nesting going to be a recommended practice Elixir-wide (so lib/ecto/ecto.ex instead of the current lib/ecto.ex) or is this a Phoenix-only thing?</p>
</blockquote>
</aside>
<p>Elixir does not care at all about how and where you place your files. And afaik Phoenix is only doing inside contexts to keep related files close together. <strong>Do what feels natural.</strong></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26004" data-batch-url="/posts/batch_likers">
                        4
                      </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-v1-3-0-rc-0-released/3947/44">Post #43</a>
	                </div>
	            </div>
              <div id="likers-container-26004" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26004"
                     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 #43"></div>
  </section>
</div>
    <div class="postbit" id="26010" data-post-id="26010">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is true from implementation perspective, but if you change the standard in Phoenix, people will start adopting it everywhere. This is how it usually works. So the right question to ask is why is that change introduced and is the idea transferable to whole ecosystem? I believe you guys have some pretty good reasons to do it this way, but since it’s new, it would be useful to talk about those reasons.</p>
<p>You’re doing amazing work with the framework and I believe Phoenix is kind of driving the whole ecosystem(along with other important projects, like Nerves). That means Phoenix is a poster boy of Elixir and Phoenix conventions will spread, even if you do not intend it too.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26010" data-batch-url="/posts/batch_likers">
                        4
                      </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-v1-3-0-rc-0-released/3947/45">Post #44</a>
	                </div>
	            </div>
              <div id="likers-container-26010" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26010"
                     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 #44"></div>
  </section>
</div>
    <div class="postbit" id="26013" data-post-id="26013">
  <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">
								<aside class="quote no-group" data-username="rafal-radziszewski" data-post="45" data-topic="3947">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rafal-radziszewski/48/4405_2.png" class="avatar"> rafal-radziszewski:</div>
<blockquote>
<p>So the right question to ask is why is that change introduced and is the idea transferable to whole ecosystem? I believe you guys have some pretty good reasons to do it this way, but since it’s new, it would be useful to talk about those reasons.</p>
</blockquote>
</aside>
<p>It is not <em>new</em>. Phoenix projects already do not follow the path conventions on entries such as <code>web/controllers/user_controller.ex</code> (which would have required its module to be named <code>MyApp.Web.Controllers.UserController</code>).</p>
<p>Mix itself keeps <code>Mix.Tasks.Escript.Build</code> in <code>lib/mix/tasks/escript.build.ex</code> instead of <code>lib/mix/tasks/escript/build.ex</code>. We do it so you can quickly glance into <code>lib/mix/tasks</code> and see all available tasks.</p>
<p>Not caring about the directory structure has been an Elixir feature from before 1.0. Different projects have leveraged it to provide better code organization under circumstances they find it worth.</p>
<p>In this case, we find that colocating the context file with other files that belong to the same context is going to help exploration. Contrast how it works now:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    + accounts
      - accounts.ex
      - foo.ex
      - bar.ex
    + backoffice
    + blog
    + payments
    + sales
    + web
</code></pre>
<p>with the old way</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    + accounts
      - foo.ex
      - bar.ex
    + backoffice
    + blog
    + payments
    + sales
    + web
    - accounts.ex
    ...
    - sales.ex
</code></pre>
<p>We find the first easier to explore if the files are all in one place. Chris even had to “cheat” in his presentation by making those files visually together while most tree viewers wouldn’t put them side by side. And yes, the idea is transferable to the whole ecosystem.</p>
<p>Therefore it is totally fine if you follow Phoenix conventions elsewhere, especially if you believe they lead to a better code structure. And if you want to try other approaches than the ones mentioned above, then discuss it with your team and go ahead with your changes if you are in agreement.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26013" data-batch-url="/posts/batch_likers">
                        18
                      </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-v1-3-0-rc-0-released/3947/46">Post #45</a>
	                </div>
	            </div>
              <div id="likers-container-26013" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26013"
                     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="26015" data-post-id="26015">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you for that extensive explanation!</p>
<p>The remarks about better discovery ring true, especially as the number of contexts will probably rise quite a bit during application lifecycle. It looks like a good idea when you put it like this.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26015" 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-v1-3-0-rc-0-released/3947/47">Post #46</a>
	                </div>
	            </div>
              <div id="likers-container-26015" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26015"
                     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 #46"></div>
  </section>
</div>
    <div class="postbit" id="26018" data-post-id="26018">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Will lib/myapp/.* be hot reloaded?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26018" 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-v1-3-0-rc-0-released/3947/48">Post #47</a>
	                </div>
	            </div>
              <div id="likers-container-26018" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26018"
                     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 #47"></div>
  </section>
</div>
    <div class="postbit" id="26024" data-post-id="26024">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just tried out the generators with a small project. One thing that I was confused by, was prefixing the table names with the bounded context name. I have the following migration which was created by: <code>mix phx.gen.html Builder Repository repositories url:string ssg:string</code></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Staticrail.Repo.Migrations.CreateStaticrail.Builder.Repository do
  use Ecto.Migration

  def change do
    create table(:builder_repositories) do
      add :url, :string
      add :ssg, :string

      timestamps()
    end

  end
end
</code></pre>
<p>I wasn’t expecting the table names to be prefixed as these are the concrete version of the entities. We could have different views of these entities through different bounded contexts. I am not completely sure if it is a bug or if the table was intentionally named this way. The fix for this for me was simple, I just removed the <code>:builder</code> prefix in the migration. Not sure how others think about this.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26024" data-batch-url="/posts/batch_likers">
                        3
                      </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-v1-3-0-rc-0-released/3947/49">Post #48</a>
	                </div>
	            </div>
              <div id="likers-container-26024" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26024"
                     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 #48"></div>
  </section>
</div>
    <div class="postbit" id="26025" data-post-id="26025">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is there a way to use <code>phx.gen.html</code> in umbrella projects?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26025" 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-v1-3-0-rc-0-released/3947/50">Post #49</a>
	                </div>
	            </div>
              <div id="likers-container-26025" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26025"
                     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 #49"></div>
  </section>
</div>
    <div class="postbit" id="26028" data-post-id="26028">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="26028" 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-v1-3-0-rc-0-released/3947/51">Post #50</a>
	                </div>
	            </div>
              <div id="likers-container-26028" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="26028"
                     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 #50"></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/3947/load_more?page=6">Load more posts</a>
</div></template></turbo-stream>