-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html.erb
46 lines (44 loc) · 1.37 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!-- This file is app/views/movies/index.html.erb -->
<h2>All Movies</h2>
<%# Part 2: Start here... %>
<%= form_tag movies_path, :method => :get, :id => 'ratings_form' do %>
Include:
<% @all_ratings.each do |rating| %>
<%= rating %>
<%= check_box_tag "ratings[#{rating}]", 1, @check.include?(rating), :id => "ratings_#{rating}" %>
<% end %>
<%= submit_tag 'Refresh', :id => 'ratings_submit', :class => 'btn btn-primary' %>
<% end %>
<table class="table table-striped col-md-12" id="movies">
<thead>
<tr>
<th>
<%= link_to 'Movie Title', movies_path(:sort => 'title', :ratings => @checked_ratings), :id => 'title_header', :class => @title_header %>
</th>
<th>Rating</th>
<th>
<%= link_to 'Release Date', movies_path(:sort => 'release_date', :ratings => @checked_ratings), :id => 'release_date_header', :class => @date_header %>
</th>
<th>More Info</th>
</tr>
</thead>
<tbody>
<% @movies.each do |movie| %>
<tr>
<td>
<%= movie.title %>
</td>
<td>
<%= movie.rating %>
</td>
<td>
<%= movie.release_date %>
</td>
<td>
<%= link_to "More about #{movie.title}", movie_path(movie) %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to 'Add new movie', new_movie_path, :class => 'btn btn-primary' %>