<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">+1 for Nesta, my personal site runs on it.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">But if you really want to stick with Rails, every 3.1+ App I’ve built with images embedded inside content called from the DB had the images sitting on a content host uploaded with Carrierwave or something similar. You just have the images with the absolute url and run them through the Markdown filter as normal. </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Images inside the app/assets/images folder should only be those either called in SCSS, for which you use the image-url helper (IIRC) or else the image_tag if you’re calling them in a view.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Tommy</div> <div id="bloop_sign_1394192405394283008" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px"><div style="font-family: Helvetica; line-height: normal;">-- </div><div style="font-family: Helvetica; line-height: normal;">Tommy Palmer</div><div style="font-family: Helvetica; line-height: normal;">@tommypalm</div><div style="font-family: Helvetica; line-height: normal;"><a href="http://tommyp.org/">http://tommyp.org/</a></div></div></div> <br><p style="color:#000;">On 7 March 2014 at 11:39:26, Najaf Ali (<a href="mailto:ali@happybearsoftware.com">ali@happybearsoftware.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>
<title></title>
<div dir="ltr"><i>> <span style="font-family:arial,sans-serif;font-size:13px"> either ignore
the asset pipeline altogether for these images (by keeping them in
public/images/articles/)</span></i>
<div><i><span style="font-family:arial,sans-serif;font-size:13px"><br></span></i></div>
<div><font face="arial, sans-serif">AFAIK you don't lose any big
benefit from working like this. The big wins from the asset
pipeline come from automatic css/js concatenation I
think.</font></div>
<div><font face="arial, sans-serif"><br></font></div>
<div><i><font face="arial, sans-serif">> </font><span style="font-family:arial,sans-serif;font-size:13px">or
find a way to evaluate Rails's asset_path() helper within my
markdown text.</span></i></div>
<div><i><span style="font-family:arial,sans-serif;font-size:13px"><br></span></i></div>
<div><font face="arial, sans-serif">Possible, but a bit hairy. In
this case I think you'd probably end up evaluating ERB within your
markdown. That will mean you're embedding ERB, within markdown,
within HAML, which has got to offend some deity
somewhere.</font></div>
<div><font face="arial, sans-serif"><br></font></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><i>> What's the
preferred approach here?</i></span><font face="arial, sans-serif"><br></font></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><i><br></i></span></div>
<div><font face="arial, sans-serif">Not sure if it's preferred and
it won't help you in this case, but after making a version of a
"markdown website with Rails" more times than I could count with
duplicate code all over the place, I've decided I'm just going to
use <a href="http://nestacms.com">nesta CMS</a>. It appears the
venn diagram of mine and Graham's (the author) taste in templating
language, project structure, etc. has a large enough intersection
that I'm happy with the defaults 99% of the time.</font></div>
<div><font face="arial, sans-serif"><br></font></div>
<div><font face="arial, sans-serif">-Ali</font></div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Mar 7, 2014 at 10:50 AM, 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">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>
_______________________________________________
<br>Chat mailing list
<br>Chat@lists.lrug.org
<br>http://lists.lrug.org/listinfo.cgi/chat-lrug.org
<br></div></div></span></blockquote></body></html>