I'm trying to create PDF's with Prawn, but I get: Prawn::Errors::UnrecognizedTableContent
Asked Answered
J

1

8

I'm following this railscasts #153, and I'm trying to add table data to prawn. I keep getting this error:

Prawn::Errors::UnrecognizedTableContent
Joinder answered 22/4, 2014 at 13:35 Comment(0)
J
16

Watch out, since prawn will get confused if your table contains any nil or non string values. Try using the .to_s method.

Example

@report.data.to_s
Joinder answered 22/4, 2014 at 13:35 Comment(3)
What if I have an image?Onto
Arslan Ali, what error are message are you getting? This error specifically refers to tabular data. Here's a list, on this page. gemfury.com/boardiq/ruby:prawn/-/content/lib/prawn/errors.rbJoinder
Every column value must be in string formatMonahon

© 2022 - 2024 — McMap. All rights reserved.