Printable Version of a Page

Hi everybody,

may somebody has already an aproach and could help me?

I have a app (REST Design) and what I would like to have is a link
like “print page”
where the actual view can be displayed in a popup and another layout.

Does anybody has a clue, whats the best way to implement this?

Thank you very much!

kind regards


I think a different stylesheet would make the most sense. Make a CSS
stylesheet that is simplified: white background, black text, any
menus/ads/etc hidden (using display: hidden or something along those
lines.) You should be able to do this without directly involving rails.


beYou media { Rafael Schär } wrote:

Hi, I just want to add one thing to the solution.

I don’t know about browser support but it should be possible to specify
both the stylesheets with the media attribute set to “screen” and
“print” (I think) and the browser is supposed to pick up the correct one
when it displays/ prints.

That way, you don’t have to worry about things like” and you don’t need to re-generate the
page (specially since you’ve already done the hard work of searching the
DB and rendering the page) - everything is done in the browser itself.

You may need to check on browser support for this - I know Firefox
supports this for sure and I expect Opera does too. I wouldn’t be
surprised if IE 7.0 also has proper support for this.

Take a look at this page for an example… you’ll see that in the screen
mode, you get to see the menus but when you do a print preview, the page
cleans up:

7/6/2007 | 12:11 PM.

Hey Elliot, thanks a lot

would you send it like this

and then make a condition for the params in the layout?

Am 05.07.2007 um 14:10 schrieb R. Elliott M.: