Skip to content

Instantly share code, notes, and snippets.

@pencilcheck
Created October 29, 2011 18:20
Show Gist options
  • Save pencilcheck/1324892 to your computer and use it in GitHub Desktop.
Save pencilcheck/1324892 to your computer and use it in GitHub Desktop.
class ResumesController < ApplicationController
before_filter :authenticate_user!
respond_to :pdf
def index
end
def preview
# Error Correction Capacity (ECC) level
# L - 7% of codewords can be recovered
# M - 15% of codewords can be recovered
# Q - 25% of codewords can be recovered
# H - 30% of codewords can be recovered
@user = User.find_by_id params[:id]
@qrcode = RQRCode::QRCode.new 'test', :size => 4, :level => :h
request.format = :pdf # need this to return pdf
respond_with prawnto :inline => true, :filename => 'preview.pdf' do
format.pdf { render :action => 'show' }
end
end
def show
# Error Correction Capacity (ECC) level
# L - 7% of codewords can be recovered
# M - 15% of codewords can be recovered
# Q - 25% of codewords can be recovered
# H - 30% of codewords can be recovered
@user = User.find_by_id params[:id]
@qrcode = RQRCode::QRCode.new 'test', :size => 4, :level => :h
request.format = :pdf # need this to return pdf
respond_with prawnto :inline => false, :filename => 'download.pdf'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment