Forum: Ruby on Rails multi-page prints

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-24 08:25
(Received via mailing list)
I am struggling with the concept of multi-page forms. I have a number of
forms all done in html and they look really good. I don't see how html
can support page breaks for printed pages but perhaps there is a way to
do that. I haven't spent all that much time on it and I do see that css
seems to have some commands for printing functions.

I was playing around with setting up loops in controller code and found
that I couldn't use render => :action within the loop because ruby
complained (sensibly I suppose) that I couldn't have multiple renders.

So I have installed the gem pdf-writer which is interesting but it has
it's own markup language which means back to the drawing board and I
won't have the tools that I have for html and I can't see any method for
it to use the html forms that I've already created.

I'm wondering how other people handle printing...especially multiple
page forms - and even most specifically, multiple pages within a loop of
objects - i.e. pseudo code...
  for product in @product
    print page


2d2e623b169075649a21a5108d17a4b7?d=identicon&s=25 Justin (Guest)
on 2006-02-24 16:21
Have you looked in to partials? While not the perfect solution they may

Also CSS has a property called page-break that can set where pages break
when printing (not sure if it's supported in all browsers) it might be
worth a look
This topic is locked and can not be replied to.