I'm wondering if there was any library or gem available in Rails for printing the contents of a web page, as in literally on to paper via a printer. I was also wondering if there was any way you can specify that only a specific part of the page (e.g. a div or something) would be printed? Any pointers, advice, or links to tutorials would be appreciated!
EDIT
so I've made a stab at creating a stylesheet which will create a print friendly view, let's call it print.css:
div.transpose-keys, div#editSong, div#navigation, div#debug{
display: none;
}
And I was wondering if there was any way I could apply it only when my application fires the print action? So that when the following is link is clicked
the application applies the css above before it prints? Here's the link in my embedded ruby html:
<%= link_to PRINT, '#', onclick: printpage() %>
And finally my javascript calling the print function:
function printpage()
{
window.print()
}