title: Rails 6 ActionText rich_text_area works normally, does not appear when rendered in a layout
body: <p>I'm rendering a form that utilizes the ActionText input rich_text_area, which is the Rails implementation of the Trix WYSIWYG rich text editor. It's been working fine until I started refactoring my views to use a layout, where the form content can yield different forms. The form renders fine <em>except</em> for the rich_text_areas, which both disappear. Removing the code required to make this a layout returns it back to normal. My code is below. </p>
  
  <p>I'm rendering a form as a partial with the following code:</p>
  
  <pre><code>&lt;%= stylesheet_link_tag "form" %&gt;
  &lt;%= form_with model: @family, class: "form-group" do |f| %&gt;
  
    &lt;%= label_tag(:banner_image, 'Select a Banner Image')%&gt;
    &lt;%= f.file_field :banner_image%&gt;
    &lt;br&gt;
    &lt;br&gt;
  
    &lt;%= label_tag(:zh_family_name, 'Chinese Family Name') %&gt;
    &lt;%= f.text_field :zh_family_name %&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;%= label_tag(:en_family_name, 'English Family Name') %&gt;
    &lt;%= f.text_field :en_family_name %&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;%= label_tag(:en_summary, 'Summary') %&gt;
    &lt;%= f.text_field :en_summary %&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;%= label_tag(:zh_summary, 'Summary Chinese') %&gt;
    &lt;%= f.text_field :zh_summary %&gt;
    &lt;br&gt;
    &lt;br&gt;
  
    &lt;%= label_tag(:en_content, 'Content') %&gt;  
    &lt;%= f.rich_text_area :en_content_rt %&gt;
    &lt;br&gt;
    &lt;br&gt;
  
    &lt;%= label_tag(:zh_content, '内容') %&gt;
    &lt;%= f.rich_text_area :zh_content_rt %&gt;
    &lt;br&gt;
    &lt;br&gt;
  
    &lt;%= label_tag(:service_id, 'Select a related service') %&gt;
    &lt;%= f.collection_select(:service_id, Service.all, :id, :en_title) %&gt;
    &lt;br&gt;
    &lt;br&gt;
    &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>It works fine and the rich text areas are visible and can be used when this form is loaded in to the edit.html.erb file as a partial like so:</p>
  
  <pre><code>&lt;%= render "partials/family_form" %&gt;
  </code></pre>
  
  <p>But I'd like to render it as part of a layout called 'editor', thus I change the edit.html.erb to this:</p>
  
  <pre><code>&lt;% content_for :form do %&gt;
    &lt;h1&gt;Edit the &lt;em&gt;&lt;%= @family.en_family_name %&gt;&lt;/em&gt; Testimonial &lt;/h1&gt;
  
    &lt;%= render "partials/family_form" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>add <code>render layout: 'editor'</code> to the edit function in the controller, and add a layout that looks like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;%= stylesheet_link_tag "editor" %&gt;
    &lt;%= yield :head %&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div class="main-container"&gt;
      &lt;div class="sidenav"&gt;
        &lt;%= render "partials/sidenav" %&gt;
      &lt;/div&gt;
      &lt;div class="content"&gt;
        &lt;%= yield :form %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I think I've narrowed it down to the <code>render layout: 'editor'</code> code being the source of the problem, since <em>directly</em> pasting the form code into the editor.html.erb layout file produces the same error: everything renders fine except for the rich text areas. </p>
  
  <p>I haven't seen this issue reported on the Trix repo and have tried manually adding <code>require 'action_text'</code> and the ActionText helper to the relevant controller, to no avail. Any help would be greatly appreciated, thanks.</p>