DEV Community

Discussion on: Step by Step guide to test Rails ActiveText

Collapse
 
colinrubbert profile image
Colin Rubbert

With regards to adding action_text to an existing app, for instance if you already had:

post.rb
:title,   t.string
:content, t.text

Would you have to run a migration to remove post :content and then implement has_rich_text :content to the model?

If you just add the has_rich_text field does it just update those paths, ignore the previous model schema, or something else?

Collapse
 
adrienpoly profile image
Adrien Poly

has_rich_text adds a polymorphic link to your table. This means that the rich text content is not stored in the posts table but in a dedicated polymorphic table for rich content.

Therefore in your case, you would need to migrate your content to this new table.