[LRUG] Assset pipeline

Andrew Stewart boss at airbladesoftware.com
Fri Mar 7 04:14:11 PST 2014


Thanks, everybody!  Lots of useful advice there.

Based on one of Murray's suggestions I'm doing this:

    # app/views/articles/show.html.haml
    :markdown
      #{assetify @article.content}

    # articles helper
    def assetify(text)
      text.gsub(%r{(/images/news/([-a-zA-Z.]*))}) { |name| asset_path("news/#{$2}") }
    end

It does the job.

Cheers,
Andy


More information about the Chat mailing list