我在rails应用程序上有一个ruby,在index.html.erb页面上循环播放每部电影以显示标题,图像,导演等。我想要做的是将电影的imdb等级显示为好。有没有办法可以做到这一点?
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) %> <%= link_to 'Edit', edit_film_path(film) %>
</div>
</div>
<div class='clearfix'></div>
</div>
</div>
<% end %>