mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 06:56:23 +02:00
Download pdf with domain data
This commit is contained in:
parent
8238b329e3
commit
318dec4f52
5 changed files with 331 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