parent
9592b1daa2
commit
93ba30a106
@ -1,23 +1,25 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
|
<ul>
|
||||||
<ul>
|
<% @movies.each do |movie| %>
|
||||||
<% @movies.each do |movie| %>
|
<section class="movie">
|
||||||
<section class="movie">
|
<div class="image">
|
||||||
<div class="summary">
|
<%= image_tag movie.image_file_name %>
|
||||||
<h2>
|
</div>
|
||||||
<%= link_to(movie.title, movie_path(movie)) %>
|
<div class="summary">
|
||||||
</h2>
|
<h2>
|
||||||
<h3>
|
<%= link_to(movie.title, movie_path(movie)) %>
|
||||||
<%= total_gross(movie) %>
|
</h2>
|
||||||
</h3>
|
<h3>
|
||||||
<p>
|
<%= total_gross(movie) %>
|
||||||
<%= truncate(movie.description, length: 150, separator: ' ') %>
|
</h3>
|
||||||
</p>
|
<p>
|
||||||
</div>
|
<%= truncate(movie.description, length: 150, separator: ' ') %>
|
||||||
</section>
|
</p>
|
||||||
<% end %>
|
</div>
|
||||||
</ul>
|
|
||||||
<section class="admin">
|
|
||||||
<%= link_to "Add New Movie", new_movie_path, class: "button" %>
|
|
||||||
</section>
|
</section>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<section class="admin">
|
||||||
|
<%= link_to "Add New Movie", new_movie_path, class: "button" %>
|
||||||
|
</section>
|
||||||
</div>
|
</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