title: how to create modular UI units (components) in Rails app?
body: <p>Let's assume we need to create simple UI component for our Rails app, for example header. We'll start by creating multiple files:</p>
  
  <p>1) <code>app/views/partials/_header.erb</code></p>
  
  <p>2) <code>app/assets/stylesheets/_header.scss</code></p>
  
  <p>3) <code>app/assets/javascript/_header.js</code></p>
  
  <p>and after that we need to include those in proper views or manifest files.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Is there an easy way to move this files to a single folder? For example: </p>
  
  <pre><code>app
  |-- ui_components
  |   |-- header
  |   |   |-- view.erb
  |   |   |-- style.scss
  |   |   |-- script.js
  </code></pre>
  
  <p>And, in case of <code>.scss</code>, include them in <code>app/assets/stylesheets/application.scss</code> by doing:</p>
  
  <pre><code>@import "ui_components/header/style"
  @import "ui_components/footer/style"
  ...
  </code></pre>
  
  <p>Same for <code>.js</code>.</p>
  
  <p>Thanks.</p>