Skip to content

Commit

Permalink
Adjust rich_text_area to rich_textarea for Rails 8 compatibility (#2180)
Browse files Browse the repository at this point in the history
* Adjust rich_text_area to rich_textarea for Rails 8 compatibility

* PR feedback - implementing missed update

Co-authored-by: Hans Lemuet <Spone@users.noreply.github.com>

* Adds CHANGELOG entry for ActionText / Rails 8.0

---------

Co-authored-by: Hans Lemuet <Spone@users.noreply.github.com>
Co-authored-by: Joel Hawksley <joel@hawksley.org>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent 3392a41 commit e85b23b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ nav_order: 5

*Reegan Viljoen*

* Updates ActionText compatibility documentation to reference `rich_textarea_tag` for Rails 8.0 support.

*Alvin Crespo*

## 3.20.0

* Allow rendering `with_collection` to accept an optional `spacer_component` to be rendered between each item.
Expand Down
6 changes: 3 additions & 3 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ With the monkey patch disabled, use `render_component` (or `render_component_to

## ActionText

Using `rich_text_area` from ActionText in a ViewComponent will result in this error:
Using `rich_textarea` from ActionText in a ViewComponent will result in this error:

`undefined method "rich_text_area_tag"`
`undefined method "rich_textarea_tag"`

This is due to ViewComponent not having access to the helpers it needs via ActionText. As a workaround, add the following to your component (or base component):

```ruby
delegate :rich_text_area_tag, to: :helpers
delegate :rich_textarea_tag, to: :helpers
```

0 comments on commit e85b23b

Please sign in to comment.