Skip to content

Instantly share code, notes, and snippets.

@brittanys
Last active October 15, 2015 17:42
Show Gist options
  • Save brittanys/03f7fcbb70e7d9648c0f to your computer and use it in GitHub Desktop.
Save brittanys/03f7fcbb70e7d9648c0f to your computer and use it in GitHub Desktop.
pdf_template = "pdfs/agency_pdf/print.html.haml"
action_view = ActionView::Base.new()
action_view.view_paths = ActionController::Base.view_paths
#AgencyPlan.where(season: season).last.each do |agency_plan|
agency_plan = AgencyPlan.where(season: 2016).last
agency_plan_decorator = AgencyPlanPdfPresenter.new(agency_plan.agency_plannable_id)
body = action_view.render(template: pdf_template, locals: {agency_plan: agency_plan_decorator})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment