0

I have a ruby on rails application that on the index.html.erb page loops around each film to display title, image, director, etc. What I would like to do is display the film's imdb rating as well. Is there a way I can do this?

index.html.erb:

<% @films.each do |film| %>
        <% if film.release_date < Date.today %>
        <div class='large_panel'>
            <%= image_tag film.image_url,:size => "900x200" %>
            <h1><%= film.title %></h1>
             <div class="bbfc-icons">
                <img src="/images/bbfc/15.png" alt="15" height="40" width="40">
            </div>

            <div class="clearfix">
            </div>  
            <div>
                <div class='film_info_two_column_left wider'>
                    <div class="allShowtimes large_txt">
                        Continues Friday 16th January - Thursday 5th February
                    </div>
                </div>

                <div class='film_info_two_column_right whatsonpgae'>
                    <div class="allShowtimes">
                        <%= link_to 'Show', film_path(film) %>&nbsp;&nbsp;&nbsp;<%= link_to 'Edit', edit_film_path(film) %>
                        </div>
                </div>

                <div class='clearfix'></div>
            </div>
        </div>
<% end %>

1 Answers1

0

This gem should be all that you need for grabbing the data from IMDB.

In addition, you can get the style for the ratings using ratyrate.

taintedzodiac
  • 2,658
  • 1
  • 18
  • 16