1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add note regarding "trix-content" class

This commit is contained in:
Steve Polito 2021-04-08 21:52:22 -04:00 committed by Jonathan Hefner
parent afa96e341b
commit e0d57541ab
2 changed files with 5 additions and 2 deletions

View file

@ -11,7 +11,8 @@ module ActionText
# that Trix will write to on changes, so the content will be sent on form submissions.
#
# ==== Options
# * <tt>:class</tt> - Defaults to "trix-content" which ensures default styling is applied.
# * <tt>:class</tt> - Defaults to "trix-content" so that default styles will be applied.
# Setting this to a different value will prevent default styles from being applied.
#
# ==== Example
#

View file

@ -85,7 +85,7 @@ end
**Note:** you don't need to add a `content` field to your `messages` table.
Then refer to this field in the form for the model:
Then use [`rich_text_area`] to refer to this field in the form for the model:
```erb
<%# app/views/messages/_form.html.erb %>
@ -114,6 +114,8 @@ class MessagesController < ApplicationController
end
```
[`rich_text_area`]: https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-rich_text_area
## Rendering Rich Text content
Action Text will sanitize and render rich content on your behalf.