Jump to content

The ultimate community for Ruby on Rails developers.


Display posts as an image

  • Please log in to reply
1 reply to this topic

#1 thegiftedhands



  • Members
  • 1 posts

Posted 02 December 2013 - 09:00 AM

How can I modify the code below so that it displays the whole output as a single image.

<li id="<%= feed_item.id %>">
<%= link_to gravatar_for(feed_item.user), feed_item.user %>
<span class="user">
<%= link_to feed_item.user.name, feed_item.user %>
<span class="content"><%= wrap(feed_item.content) %></span>
<span class="timestamp">
Posted <%= time_ago_in_words(feed_item.created_at) %> ago.

The code above is from: app\views\shared\feed.html.erb


#2 Ohm



  • Moderators
  • 529 posts
  • LocationCopenhagen

Posted 02 December 2013 - 11:34 AM

Image? You want to generate an image from your generated html?


What is the use-case here? You could use something like wkhtmltoimage (https://code.google.com/p/wkhtmltopdf/) to generate the image server side and then just show that image.

Blog: http://ohm.sh | Twitter: @madsohm | Work: Lokalebasen.dk

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users