2

Mobility has a syntax to translate Rails ActiveRecord strings and text:

class Word < ApplicationRecord
  extend Mobility
  translates :content
end

On the other hand, here is the syntax to declare rich text with ActionText:

class Word < ApplicationRecord
  has_rich_text :content
end

How can these be combined to efficiently translate rich text with Mobility? Ideally I want to avoid doing a double-join as suggested here in the context of Globalize, i.e. avoiding needing to join a translation table then joining a rich-text table.

There seems to be an opportunity to combine both steps using the ActionText table, which is already a polymorphic relationship similar to the key-value backend, so that the translation would be available "for free" with no performance impact compared to untranslated rich text.

2 Answers2

0

I guess this is why action-text-attachment tag are not rendered in the views yet.

olimart
  • 1,529
  • 3
  • 17
  • 32
0

This is now possible with Mobility Action Text.