AD
Size: a a a
AD
AD
YB
s
def download_certificate
@course_user = @course.courses_users.find_by(user: current_user)
pdf = WickedPdf.new.pdf_from_string(
render_to_string('courses/certificate_pdf', layout: false),
margin: {top: 0, bottom: 0, left: 0, right: 0},
orientation: 'Landscape'
)
send_data pdf, filename: 'certificate.pdf', type: 'application/pdf', disposition: 'attachment'
end
Как подобное реализовать через Grape api? Или подобным образом сделать не получится?IN
IN
AI
IN
SR
КМ
АК
HH
HH
NP
def download_certificate
@course_user = @course.courses_users.find_by(user: current_user)
pdf = WickedPdf.new.pdf_from_string(
render_to_string('courses/certificate_pdf', layout: false),
margin: {top: 0, bottom: 0, left: 0, right: 0},
orientation: 'Landscape'
)
send_data pdf, filename: 'certificate.pdf', type: 'application/pdf', disposition: 'attachment'
end
Как подобное реализовать через Grape api? Или подобным образом сделать не получится?NP
NP
Т
NP
NP