Ask A Question


You’re not receiving notifications from this thread.

ActionText and Globalize error

Alexey Poimtsev asked in Rails

I have application which is using globalize gem and i planning to start using ActionText. So, for example i have model called Business

class Business < ApplicationRecord
  translates :name, :description

  has_rich_text :description

and i created an record in database. But on attempt to edit i see following error

undefined method `body' for "<div><strong>jfgjwhgewr</strong></div>":String

for my form

    - I18n.available_locales.each do |locale|
      = f.input :"name_#{locale.to_s}", label: "Name (#{locale.to_s})"
    - I18n.available_locales.each do |locale|
      = f.label "Description (#{locale.to_s})"
      = f.rich_text_area :"description_#{locale.to_s}"

Whats wrong with it and how can i solve this issue?

PS: I found but this solution looks little bit strange :(


Hi Alexey,
Did you find any solution for this? I am getting the same error.
I added description to the tranlsation table as text.



Not yet :( I paused this task and started working on another issue. Will back with (i hope) a solution soon


I have this issue too. But i dont use globalize. Its actiontext error and i am not found any solution


suppose you use globalize gem and did the migration according to globalize docs ->

class CreateTranslation < ActiveRecord::Migration[6.0]
  def up
    Business.create_translation_table!({name: :string,  description: text}, { migrate_data: true })

  def down
    Business.drop_translation_table! migrate_data: true

remove from model:

has_rich_text :description

and try to use the following in the view:

<%= rich_text_area_tag "business[name]", %>
<%= rich_text_area_tag "business[description]",  f.object.description %>

Encountering this same issue with action text


I am seeing this error, too. I am trying to use a form object. This only occurs when the form object fails to save and the form must be redrawn. I am guessing it has to do with new_record?

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 78,890+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.