You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.
I like the inclusion of a rich-text editor in rails by default.
One issue I'd like to raise is internationalization/translations. I've been using the globalize gem to save translation records for fields on models that have translations. Now I was wondering if this will work for rich text fields, too.
The text was updated successfully, but these errors were encountered:
I gave it a try and doesn't quite work as expected but I've come up with a quick hack to get it working. I delegated all the methods has_rich_text creates to the translation and attached has_rich_text :content to the translation class by opening up globalize's nested Translation class. You can find an example below with a Post model that has content as the rich text field.
Disclaimer: Not fully tested.
class Post < ApplicationRecord
translates :title, :content, touch: true
delegate :content, to: :translation
delegate :content=, to: :translation
after_save do
content.save if content.changed?
end
class Translation
has_rich_text :content
end
end
Action Text has been merged into Rails. Please do investigate whether Action Text plays nicely with popular plugins and report back to rails/rails if there’s anything we can reasonably do in the framework to address incompatibilities.
Hello,
I like the inclusion of a rich-text editor in rails by default.
One issue I'd like to raise is internationalization/translations. I've been using the
globalize
gem to save translation records for fields on models that have translations. Now I was wondering if this will work for rich text fields, too.The text was updated successfully, but these errors were encountered: