[LRUG] Assset pipeline
Murray Steele
murray.steele at gmail.com
Fri Mar 7 05:50:04 PST 2014
Repost for the list. Oops!
On 7 March 2014 11:04, Murray Steele <murray.steele at gmail.com> wrote:
> Where do the images that the asset paths refer to come from?
>
> Are they static? If so then it might be easiest to just leave them in
> /public/.
>
> If they're dynamic, or you want to use the asset-pipeline to get proper
> versioning of those static assets you could consider either:
>
> 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'),
> 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).
>
> Muz
>
>
>
>
> On 7 March 2014 10:50, Andrew Stewart <boss at airbladesoftware.com> wrote:
>
>> Hello LRUG!
>>
>> 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:
>>
>> # app/views/articles/show.html.haml
>> %h1= @article.title
>> :markdown
>> #{@article.contents}
>>
>> Some of these articles contain images. Previously all the image
>> references looked like:
>>
>> ![Some text here](/images/articles/some-photo.png)
>>
>> Given the asset pipeline, what paths should I use now?
>>
>> I see two options:
>>
>> - either ignore the asset pipeline altogether for these images (by
>> keeping them in public/images/articles/);
>> - or find a way to evaluate Rails's asset_path() helper within my
>> markdown text.
>>
>> What's the preferred approach here?
>>
>> Thanks in advance,
>>
>> Andy Stewart
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20140307/db27c0f5/attachment-0003.html>
More information about the Chat
mailing list