-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
16 changed files
with
280 additions
and
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
class ErrorsController < ApplicationController | ||
def not_found | ||
render status: :not_found | ||
respond_to do |format| | ||
format.html { render status: :not_found } | ||
format.json { render json: { error: 'not_found' }, status: :not_found } | ||
end | ||
end | ||
|
||
def internal_server_error | ||
render status: :internal_server_error | ||
respond_to do |format| | ||
format.html { render status: :internal_server_error } | ||
format.json { render json: { error: 'server_error' }, status: :internal_server_error } | ||
end | ||
end | ||
end |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<code | ||
data-controller="clipboard" | ||
class=" | ||
w-full text-sm sm:text-base inline-flex text-left items-center space-x-4 | ||
bg-gray-800 text-white rounded-lg p-4 pl-6 | ||
" | ||
> | ||
<p class="w-full" data-clipboard-target="source"> | ||
<%= yield %> | ||
</p> | ||
|
||
<button | ||
data-action="clipboard#copy" | ||
class=" | ||
border border-gray-500 rounded-full text-gray-500 hover:text-white transition | ||
py-1 px-4 gap-1 flex flex-row items-center justify-center self-start | ||
" | ||
> | ||
<svg | ||
class="shrink-0 h-5 w-5" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 20 20" | ||
fill="currentColor" | ||
aria-hidden="true" | ||
> | ||
<path d="M8 2a1 1 0 000 2h2a1 1 0 100-2H8z"></path> | ||
<path | ||
d="M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z" | ||
> | ||
</path> | ||
</svg> | ||
<span data-clipboard-target="trigger">Copy</span> | ||
</button> | ||
</code> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
json.extract! upload, :key, :expiry, :remaining_uses, :created_at | ||
json.extract! upload, :key, :expiry, :uses, :created_at | ||
json.url Rails.application.routes.url_helpers.download_url(upload) | ||
json.name upload.data.filename.to_s |
Oops, something went wrong.