mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 21:46:24 +02:00
Merge pull request #2396 from internetee/2391-domain-pdf
Admin: download pdf with domain data on show
This commit is contained in:
commit
c488085cb3
7 changed files with 276 additions and 3 deletions
|
@ -2,7 +2,7 @@ module Admin
|
|||
class DomainsController < BaseController
|
||||
DEFAULT_VERSIONS_PER_PAGE = 10
|
||||
|
||||
before_action :set_domain, only: %i[show edit update keep]
|
||||
before_action :set_domain, only: %i[show edit update download keep]
|
||||
authorize_resource
|
||||
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
|
@ -65,6 +65,11 @@ module Admin
|
|||
.per(DEFAULT_VERSIONS_PER_PAGE)
|
||||
end
|
||||
|
||||
def download
|
||||
filename = "#{@domain.name}.pdf"
|
||||
send_data @domain.as_pdf, filename: filename
|
||||
end
|
||||
|
||||
def keep
|
||||
@domain.keep
|
||||
redirect_to edit_admin_domain_url(@domain), notice: t('.kept')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue