how use html view/partial to pdf view with wicked_pdf gem?

Viewed 1844
def foo    
  respond_to do |format|
    format.html { render layout: 'application' }
    format.pdf { 
      render pdf: 'foo', layout: 'pdf'
    }
  end
end

if I put only hello world in foo.pdf.erb it works !

but now if I want use a html view to iterate on my model (from DB) like :

<p>hello world</p>    
<%= render @foo.chapters.order(number: :asc) %>

it doest works, the page stay grey, no error in log...

if i comment this line, hello world works again.

So the issu is about using html partial : how can we use the normal html view in pdf view?

1 Answers
Related