I'm working on a Ruby on Rails project that uses RefineryCMS-blog. I'm trying to create send the rss feed through feed burner so that people can subscribe and such, but I found the images aren't working.
I quickly figured out that it's because of the images using relative paths instead of full urls. I went back to my project to try to change it, but I can't find what to change/override to be able to fix it. The problem is contained in the Post. But refinery takes care of everything inside of that, setting the Post.body and such.
Is there something I can override to fix how Post.body gets set, so that I can change the image_path to image_url inside of that?
The way I eventually had to do it was similar to this gist. I essentially used the same code (below) but put it in a different function somewhere else.
The reason a substitution was necessary was because the wysiwyg editor hardcodes it. The way to combat it is to either change it on the way in or the way out. If you only use it one or two times, then using this function on the way out was easiest (but probably less correct).
Be sure you set your asset_host values in the config files to ensure this works.
def use_full_paths(existing_content)
existing_content.gsub!(%r{src=\"(/system)}) do |m|
m.to_s.gsub(
%q{src="},
%Q{src="#{Rails.application.config.action_controller.asset_host}#{m.gsub('src="/system', '')}}
)
end if existing_content.present?
existing_content
end