Skip to content

Instantly share code, notes, and snippets.

@frankolson
Created August 8, 2019 00:48
Show Gist options
  • Save frankolson/4f7794c008ad39d0b0b2f29392dcbbc3 to your computer and use it in GitHub Desktop.
Save frankolson/4f7794c008ad39d0b0b2f29392dcbbc3 to your computer and use it in GitHub Desktop.
Trix Editor view example
<%= form_with model: @article do |form| %>
<div class="field">
<%= form.label :title %>
<%= form.text_field :title, placeholder: 'Title' %>
</div>
<div class="field">
<input id="article_content" type="hidden" name="article[content]"
value="<%= form.content %>">
<trix-editor input="article_content"></trix-editor>
</div>
<%= form.submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment