Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Wiki
  • Field: RichTextAreaField

Field: RichTextAreaField · Changes

Page history
Created Field: RichTextAreaField (markdown) authored Feb 22, 2019 by Derk-Jan Karrenbeld's avatar Derk-Jan Karrenbeld
Hide whitespace changes
Inline Side-by-side
Field:-RichTextAreaField.md 0 → 100644
View page @ 4afe0164
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
Clone repository

User Docs

  • List of Plugins