mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 14:36:22 +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
|
@ -743,6 +743,12 @@ class Domain < ApplicationRecord
|
|||
]
|
||||
end
|
||||
|
||||
def as_pdf
|
||||
domain_html = ApplicationController.render(template: 'domain/pdf', assigns: { domain: self })
|
||||
generator = PDFKit.new(domain_html)
|
||||
generator.to_pdf
|
||||
end
|
||||
|
||||
def registrant_name
|
||||
return registrant.name if registrant
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue