Skip to content

Can't render ViewComponent with rich_text_area #445

@helphop

Description

@helphop

Steps to reproduce

I have the following View Component:

<%= form_with(model: [post, element]) do |form| %>
  <%= form.rich_text_area :content %>
  <div class="mt-3 d-flex justify-content-between">
    <div>
      <%= form.submit "Save", class: 'btn btn-primary' %>
      <a href="#" class="cancel btn btn-secondary">Cancel</a>
    </div>
      <%= link_to 'Delete', post_element_path(post, element), method: :delete, class: 'btn btn-danger', data: { confirm: 'Are you sure?'} %>
  </div>
<% end %>

Expected behavior

This should render the Trix Action Text Editor

Actual behavior

ActionView::Template::Error (undefined method `rich_text_area_tag' for #ParagraphFormComponent:0x00007f9734219b48)

System configuration

Rails version:
Rails 6.0.3.2
Ruby version:
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
Gem version:
Using view_component 2.18.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions