link to - How do I link_to VIEW a pdf resource (NOT download) in a custom engine on RefineryCMS? -
i'm novice rorr , i'm building company's website on refinerycms.
i've created engine boss' publications, within included pdf:resource column , have uploaded articles backend. works - renders , downloads work.
however, want able view pdf's _blank target through link_to on article.title. see code below !!!xxxxxxxxx_path , or useable variation, i'm looking for!!!
the important thing corresponding pdf being rendered. is, know can't manually code individual links while using [.each do] loop.
i'm sure there way done but, said, i'm novice , use help.
here's code:
<section id="body_content"> <section id="body"> <section id=articles> <% @articles.each |article| %> <div class=wrapper> <div class=particle> <h1><%= link_to article.title, **(xxxxxxxxxxxxxxx.pdf)**, :target => '_blank' %></h1> <p><span class=publisher><%= article.publication %></span>, <span class=year><%= article.year %></span> </p> <% if article.pdf.present? %> <%= link_to image_tag("/assets/pdf.png", :size => "30x30"), article.pdf.url, :title => "pdf download", :class => "pdflink" %> <% else %> pdf <% end %> </div> <% end %> </div> </section> </section>
any appreciated.
*side note: next task add link email article (as attachment) third party. again, i'd imagine there's in actionmailer can before started great.
much obliged.
sorry read question wrong. try instead
to indicate browser file should viewed in browser:
content-type: application/pdf content-disposition: inline; filename.pdf
to have file downloaded rather viewed:
content-type: application/pdf content-disposition: attachment; filename.pdf
Comments
Post a Comment