parent
9592b1daa2
commit
93ba30a106
@ -1,23 +1,25 @@
|
||||
<div class="container">
|
||||
|
||||
<ul>
|
||||
<% @movies.each do |movie| %>
|
||||
<section class="movie">
|
||||
<div class="summary">
|
||||
<h2>
|
||||
<%= link_to(movie.title, movie_path(movie)) %>
|
||||
</h2>
|
||||
<h3>
|
||||
<%= total_gross(movie) %>
|
||||
</h3>
|
||||
<p>
|
||||
<%= truncate(movie.description, length: 150, separator: ' ') %>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<% end %>
|
||||
</ul>
|
||||
<section class="admin">
|
||||
<%= link_to "Add New Movie", new_movie_path, class: "button" %>
|
||||
<ul>
|
||||
<% @movies.each do |movie| %>
|
||||
<section class="movie">
|
||||
<div class="image">
|
||||
<%= image_tag movie.image_file_name %>
|
||||
</div>
|
||||
<div class="summary">
|
||||
<h2>
|
||||
<%= link_to(movie.title, movie_path(movie)) %>
|
||||
</h2>
|
||||
<h3>
|
||||
<%= total_gross(movie) %>
|
||||
</h3>
|
||||
<p>
|
||||
<%= truncate(movie.description, length: 150, separator: ' ') %>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<% end %>
|
||||
</ul>
|
||||
<section class="admin">
|
||||
<%= link_to "Add New Movie", new_movie_path, class: "button" %>
|
||||
</section>
|
||||
</div>
|
||||
|
@ -0,0 +1,7 @@
|
||||
class AddMoreFieldsToMovies < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :movies, :director, :string
|
||||
add_column :movies, :duration, :string
|
||||
add_column :movies, :image_file_name, :string
|
||||
end
|
||||
end
|
Loading…
Reference in new issue