|
|
In order to use administrate with ActionText, create a new `RichTextAreaField`.
|
|
|
|
|
|
Create `app/fields/rich_text_area_field.rb`
|
|
|
```ruby
|
|
|
require "administrate/field/text"
|
|
|
|
|
|
class RichTextAreaField < Administrate::Field::Text
|
|
|
def to_s
|
|
|
data
|
|
|
end
|
|
|
end
|
|
|
```
|
|
|
|
|
|
Create `app/views/fields/rich_text_area_field/_form.html.erb`
|
|
|
```erb
|
|
|
<div class="field-unit__label">
|
|
|
<%= f.label field.attribute %>
|
|
|
</div>
|
|
|
<div class="field-unit__field">
|
|
|
<%= f.rich_text_area field.attribute %>
|
|
|
</div>
|
|
|
```
|
|
|
|
|
|
Create both `app/views/fields/rich_text_area_field/_index.html.erb` (don't recommend showing this in a collection view) and `app/views/fields/rich_text_area_field/_show.html.erb`
|
|
|
```erb
|
|
|
<%= field.to_s %>
|
|
|
```
|
|
|
|
|
|
Instructions on getting the JS and CSS included are listed in the [Rails 6 & Webpacker](https://github.com/thoughtbot/administrate/wiki/Rails-6-&-Webpacker) wiki. |
|
|
\ No newline at end of file |