-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ca48e7
commit 04afbfa
Showing
23 changed files
with
85 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
<h1>Editing Image</h1> | ||
|
||
<%= form_with(url: image_path, method: "post", :html => {:class => "form-horizontal center"}) do |form| %> | ||
<%= form_with(url: image_path(@image), method: "put", :html => {:class => "form-horizontal center"}) do |form| %> | ||
<div class="form-group"> | ||
<%= form.label(:title, "Image Title:") %> | ||
<%= form.text_field :title, :required => true %> | ||
<%= form.text_field :title, :value => @image.title %> | ||
</div> | ||
<div class="form-group"> | ||
<%= form.label(:tags, "Choose Tags:") %> | ||
<%= form.text_field :tags%> | ||
<%= form.text_field :tags, :value => @image.tags%> | ||
</div> | ||
<div class="form-group"> | ||
<%= form.label(:private, "Make Picture Public:") %> | ||
<%= form.check_box :private %> | ||
</div> | ||
|
||
<%= submit_tag("Upload") %> | ||
|
||
<%= submit_tag("Save", :class => "btn btn-light") %> | ||
<%= link_to 'Back', @image , :class => "btn btn-light"%> | ||
<%= button_to "Delete", { controller: :images, action: :destroy, id: @image.id }, method: :delete, data: { confirm: 'Are you sure?' }, :class => "btn btn-light" %> | ||
|
||
|
||
<% end %> | ||
|
||
|
||
<%= link_to 'Show', @image %> | | ||
<%= link_to 'Back', images_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
<p id="notice"><%= notice %></p> | ||
|
||
<h1>Images</h1> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th colspan="3"></th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<% @images.each do |image| %> | ||
<tr> | ||
<td><%= link_to 'Show', image %></td> | ||
<td><%= link_to 'Edit', edit_image_path(image) %></td> | ||
<td><%= link_to 'Destroy', image, method: :delete, data: { confirm: 'Are you sure?' } %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<br> | ||
|
||
<%= link_to 'New Image', new_image_path %> | ||
<h1>Public Images</h1> | ||
|
||
<div class="card-columns"> | ||
<% @images.each do |img| %> | ||
<div class="card"> | ||
<div class="card-block" > | ||
<%= image_tag img.file , :width => "100%" %> | ||
<div class="card-body"> | ||
<p class="card-title"><%= img.title %></p> | ||
|
||
<% if img.tags %> | ||
<p class="card-subtitle mb-2 text-muted">Tags: <%= img.tags %></p> | ||
<% end %> | ||
|
||
<%= link_to "View", image_path(img), :class => "btn btn-light" %> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
|
||
<% end %> | ||
|
||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.