to make HTML public ◦ Authorization in Rails App • Install ◦ $ yarn add puppeteer • Flow ◦ Authentication / Authorization ◦ Generate HTML file ◦ Generate PDF file from HTML file (by puppeteer) ◦ Respond PDF file
= 'articles/show.html.erb' respond_to do |f| f.html do @is_pdf = false render template_path end f.pdf do @is_pdf = true render_pdf_from_template "#{@article.title}-#{Time.zone.now.to_date.to_s}", template_path end end end ••• end