Question

<%= image_tag(movie_info.poster_url, :class => 'img-polaroid') %>

HTML output:

<img alt="Mv5bmje1odcyodyxml5bml5banbnxkftztcwnja1nde3mq@@._v1_" class="img-polaroid" src="http://ia.media-imdb.com/images/M/MV5BMjE1ODcyODYxMl5BMl5BanBnXkFtZTcwNjA1NDE3MQ@@._V1_.jpg">

Which doesn't display the image, does imdb block access to its images externally?

Was it helpful?

Solution

When I paste your image source value into my browser bar the image displays fine. Try checking the css properties of class "img-polaroid" perhaps it alters the visibility. Otherwise the html is fine. and the rails view helper is also doing it job right.

OTHER TIPS

<% agent = Mechanize.new %>
<% link = movie_info.poster_url %>
<% agent.get(link).save "#{movie["imdb_id"].to_s}.jpg" %>

A fix to bypass the restriction behind imdb, download mechanize and store the image local

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top