<div dir="ltr">Repost for the list. Oops!<div class="gmail_extra"><br><div class="gmail_quote">On 7 March 2014 11:04, Murray Steele <span dir="ltr"><<a href="mailto:murray.steele@gmail.com" target="_blank">murray.steele@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Where do the images that the asset paths refer to come from?<div><br></div><div>Are they static?  If so then it might be easiest to just leave them in /public/. </div>
<div><br></div><div>If they’re dynamic, or you want to use the asset-pipeline to get proper versioning of those static assets you could consider either:</div>
<div><br></div><div>1. pre-parsing the markdown to find local image references and replace /image/articles/some-photo.png with the output of asset_path(’articles/some-photo.png’),</div><div>2. creating a custom bit of markdown formatting (perhaps: ![Some text here]{some-photo}) and parsing that separately (I think most markdown engines allow you to hook in and provide new bits of formatting).</div>

<div><br></div><div>Muz</div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 7 March 2014 10:50, Andrew Stewart <span dir="ltr"><<a href="mailto:boss@airbladesoftware.com" target="_blank">boss@airbladesoftware.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello LRUG!<br>
<br>
I'm upgrading a Rails app from 3.0 to 3.1.  I have an article model which stores the article's text as markdown.  I use HAML's markdown filter to render it like this:<br>
<br>
    # app/views/articles/show.html.haml<br>
    %h1= @article.title<br>
    :markdown<br>
      #{@article.contents}<br>
<br>
Some of these articles contain images.  Previously all the image references looked like:<br>
<br>
    ![Some text here](/images/articles/some-photo.png)<br>
<br>
Given the asset pipeline, what paths should I use now?<br>
<br>
I see two options:<br>
<br>
- either ignore the asset pipeline altogether for these images (by keeping them in public/images/articles/);<br>
- or find a way to evaluate Rails's asset_path() helper within my markdown text.<br>
<br>
What's the preferred approach here?<br>
<br>
Thanks in advance,<br>
<br>
Andy Stewart<br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>