now this is what i call an app
This commit is contained in:
commit
8063246b68
97 changed files with 1989 additions and 0 deletions
11
app/views/tapes/_form.html.erb
Normal file
11
app/views/tapes/_form.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<%= form_with model: tape do |form| %>
|
||||
<div>
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.file_field :video, :accept => 'video/quicktime,video/mp4' %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
4
app/views/tapes/edit.html.erb
Normal file
4
app/views/tapes/edit.html.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<h1>Edit tape</h1>
|
||||
|
||||
<%= render "form", tape: @tape %>
|
||||
<%= link_to "Cancel", @tape %>
|
||||
11
app/views/tapes/index.html.erb
Normal file
11
app/views/tapes/index.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<h1>Tapes</h1>
|
||||
|
||||
<%= link_to "New tape", new_tape_path if authenticated? %>
|
||||
|
||||
<div id="tapes">
|
||||
<% @tapes.each do |tape| %>
|
||||
<div>
|
||||
<%= link_to tape.title, tape %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
4
app/views/tapes/new.html.erb
Normal file
4
app/views/tapes/new.html.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<h1>New tape</h1>
|
||||
|
||||
<%= render "form", tape: @tape %>
|
||||
<%= link_to "Cancel", tapes_path %>
|
||||
11
app/views/tapes/show.html.erb
Normal file
11
app/views/tapes/show.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<% cache @tape do %>
|
||||
<h1><%= @tape.title %></h1>
|
||||
<% end %>
|
||||
<% if @tape.video.attached? %>
|
||||
<%= video_tag @tape.video, :controls => true%>
|
||||
<% end %>
|
||||
<%= link_to "Back", tapes_path%>
|
||||
<% if authenticated? %>
|
||||
<%= link_to "Edit", edit_tape_path(@tape) %>
|
||||
<%= button_to "Delete", @tape, method: :delete, data: { turbo_confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue