mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #41889 from stevepolitodesign/main
Add note regarding "trix-content" class. [ci-skip]
This commit is contained in:
commit
c831dea915
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.
|
||||
#
|
||||
# ==== 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
|
||||
#
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue