image not dispayed in pdfkit(pdfkit)

561 views
Skip to first unread message

Ragesh R.

unread,
Nov 6, 2015, 4:29:45 AM11/6/15
to rubyonra...@googlegroups.com
I am using Carrierwave to upload images in rails4.

In the view page the uploaded image is showing. But, when generating the
pdf,
from this view, the image is not showing.Instead , a blank box is
showing.from many from frorums i got a suggestion that use the absolute
url to display images in pdf

From the view, while inspecting the path is showing as below:

<img alt="Small images" src=" http://127.0.0.1:3000/upload_
files/6/student/image/1/small_images.jpg">

The code i used is:

<%=image_tag Student.find(id).image_url(:small) %>

Can u pls help...

--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Nov 6, 2015, 5:43:07 AM11/6/15
to Ruby on Rails: Talk
On 6 November 2015 at 09:28, Ragesh R. <li...@ruby-forum.com> wrote:
> I am using Carrierwave to upload images in rails4.
>
> In the view page the uploaded image is showing. But, when generating the
> pdf,
> from this view, the image is not showing.Instead , a blank box is
> showing.from many from frorums i got a suggestion that use the absolute
> url to display images in pdf
>
> From the view, while inspecting the path is showing as below:
>
> <img alt="Small images" src=" http://127.0.0.1:3000/upload_
> files/6/student/image/1/small_images.jpg">

Not entirely sure what you are saying. Are you saying that the above
url does not show the image it should or that it is not the right url?
Also not sure what it has to do with pdf. All that code is doing is
displaying an image, it is not displaying an image "in pdf".
Look in log/development.log and put that url into the browser to see
what it is doing.

Colin
Reply all
Reply to author
Forward
0 new messages