Skip to content

Instantly share code, notes, and snippets.

@sapient
Forked from pencilcheck/resumes_controller.rb
Created October 29, 2011 18:26
Show Gist options
  • Save sapient/1324899 to your computer and use it in GitHub Desktop.
Save sapient/1324899 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
render :action => "show"
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