Complete Lesson 14
This commit is contained in:
parent
a5018ba917
commit
bc7bcca0c3
6
app/views/layouts/_footer.html.erb
Normal file
6
app/views/layouts/_footer.html.erb
Normal file
@ -0,0 +1,6 @@
|
||||
<footer>
|
||||
<p>
|
||||
Copyright © <%= Time.now.year %>
|
||||
<%= link_to "Skyleaf Design", "https://skyleafdesign.com/" %>
|
||||
</p>
|
||||
</footer>
|
6
app/views/layouts/_header.html.erb
Normal file
6
app/views/layouts/_header.html.erb
Normal file
@ -0,0 +1,6 @@
|
||||
<header>
|
||||
<div class="alert alert-primary" role="alert">
|
||||
<h1>The only movies that actually matter</h1>
|
||||
<%= link_to image_tag("logo.png"), root_path %>
|
||||
</div>
|
||||
</header>
|
@ -12,20 +12,10 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<div class="alert alert-primary" role="alert">
|
||||
<h1>The only movies that actually matter</h1>
|
||||
<%= link_to image_tag("logo.png"), root_path %>
|
||||
</div>
|
||||
</header>
|
||||
<%= render "layouts/header" %>
|
||||
<div class="content">
|
||||
<%= yield %>
|
||||
</div>
|
||||
<footer>
|
||||
<p>
|
||||
Copyright © <%= Time.now.year %>
|
||||
<%= link_to "Skyleaf Design", "https://skyleafdesign.com/" %>
|
||||
</p>
|
||||
</footer>
|
||||
<%= render "layouts/footer" %>
|
||||
</body>
|
||||
</html>
|
||||
|
18
app/views/movies/_form.html.erb
Normal file
18
app/views/movies/_form.html.erb
Normal file
@ -0,0 +1,18 @@
|
||||
<%= form_with(model: movie) do |f| %>
|
||||
<%= f.label :title %>
|
||||
<%= f.text_field :title, autofocus: true %>
|
||||
|
||||
<%= f.label :description %>
|
||||
<%= f.text_area :description, rows: 10 %>
|
||||
|
||||
<%= f.label :rating %>
|
||||
<%= f.text_field :rating %>
|
||||
|
||||
<%= f.label :released_on %>
|
||||
<%= f.date_field :released_on %>
|
||||
|
||||
<%= f.label :total_gross %>
|
||||
<%= f.number_field :total_gross %>
|
||||
|
||||
<%= f.submit %>
|
||||
<% end %>
|
@ -1,20 +1,3 @@
|
||||
<h1>Editing <%= @movie.title %></h1>
|
||||
|
||||
<%= form_with(model: @movie) do |f| %>
|
||||
<%= f.label :title %>
|
||||
<%= f.text_field :title %>
|
||||
|
||||
<%= f.label :description %>
|
||||
<%= f.text_area :description, rows: 7 %>
|
||||
|
||||
<%= f.label :rating %>
|
||||
<%= f.text_field :rating %>
|
||||
|
||||
<%= f.label :released_on %>
|
||||
<%= f.date_field :released_on %>
|
||||
|
||||
<%= f.label :total_gross %>
|
||||
<%= f.number_field :total_gross %>
|
||||
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<%= render "form", movie: @movie %>
|
||||
|
@ -1,20 +1,3 @@
|
||||
<h1>Creating a New Movie</h1>
|
||||
|
||||
<%= form_with(model: @movie) do |f| %>
|
||||
<%= f.label :title %>
|
||||
<%= f.text_field :title %>
|
||||
|
||||
<%= f.label :description %>
|
||||
<%= f.text_area :description, rows: 7 %>
|
||||
|
||||
<%= f.label :rating %>
|
||||
<%= f.text_field :rating %>
|
||||
|
||||
<%= f.label :released_on %>
|
||||
<%= f.date_field :released_on %>
|
||||
|
||||
<%= f.label :total_gross %>
|
||||
<%= f.number_field :total_gross %>
|
||||
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<%= render "form", movie: @movie %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user