This is the advanced approach with example
class FundsController < ApplicationController
def index
@funds = Fund.all_funds(current_user)
end
def show
@fund = Fund.find(params[:id])
respond_to do |format|
format.html
format.pdf do
pdf = FundsPdf....
You need to add Gem and PDF MIME:Type inside mime_types.rb as we need to notify rails about PDF mime type.
After that we can generate Pdf with Prawn in following basic ways
This is the basic assignment
pdf = Prawn::Document.new
pdf.text "Hello World"
pdf.render_file "assignment.p...