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:
parent
afa96e341b
commit
e0d57541ab
2 changed files with 5 additions and 2 deletions
|
@ -11,7 +11,8 @@ module ActionText
|
||||||
# that Trix will write to on changes, so the content will be sent on form submissions.
|
# that Trix will write to on changes, so the content will be sent on form submissions.
|
||||||
#
|
#
|
||||||
# ==== Options
|
# ==== 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
|
# ==== Example
|
||||||
#
|
#
|
||||||
|
|
|
@ -85,7 +85,7 @@ end
|
||||||
|
|
||||||
**Note:** you don't need to add a `content` field to your `messages` table.
|
**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
|
```erb
|
||||||
<%# app/views/messages/_form.html.erb %>
|
<%# app/views/messages/_form.html.erb %>
|
||||||
|
@ -114,6 +114,8 @@ class MessagesController < ApplicationController
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
[`rich_text_area`]: https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-rich_text_area
|
||||||
|
|
||||||
## Rendering Rich Text content
|
## Rendering Rich Text content
|
||||||
|
|
||||||
Action Text will sanitize and render rich content on your behalf.
|
Action Text will sanitize and render rich content on your behalf.
|
||||||
|
|
Loading…
Reference in a new issue