locomotivecms/engine — Issue #259: Import: assets samples are not replaced in content
Author: andreacampi
Created: 2011-12-29 09:05:14+00:00
State: open

I see Locomotive::Import::Pages#replace_images! will go through the template and fix up any reference to assets.
I kind of expected the same to work for content.

Use case: I am using locomotive_editor to write the user guide for our application; I need to be able to add e.g. a screenshot, preview the document and then import the theme.
Using a file custom_field wouldn't work, as I can't predict how many images I will need in a document.

The best option seems to be calling #replace_images! from ContentType#insert_samples too.
Can you see any downsides to that? if it sounds ok, I will take a stab at it and send a pull request.