mwlang / gentelella-rails-demo

A Rails 5.x project that demonstrates the gentelella-rails gem
29 stars 39 forks source link

Using partials #2

Closed tomecho closed 7 years ago

tomecho commented 7 years ago

Hey I notice this doesnt employ one of the main features of ERB, use of partials. For example it could look like this in the layout.

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
          <div class="left_col scroll-view">
            <%= render partial: 'layouts/shared/leftnav' %>
          </div>
        </div>

        <!-- top navigation -->
        <div class="top_nav">
          <div class="nav_menu">
            <nav>
              <%= render partial: 'layouts/shared/topnav' %>
            </nav>
          </div>
        </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
          <%= yield %>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <footer>
          <%= render partial: 'layouts/shared/footer' %>
        </footer>
        <!-- /footer content -->
      </div>
    </div>
    <%= javascript_include_tag 'application' %>
  </body>
mwlang commented 7 years ago

I'd love to take the project in this direction. It was really an experimental exploration to see if I could build the gem that backs this demo project, so I did the bare minimum to put this demo together.

I will gladly accept PR's that further carries this project towards the Rails standard.