title: Printing stuff in rails (literally to a printer)
body: <p>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! </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>so I've made a stab at creating a stylesheet which will create a print friendly view, let's call it "print.css":</p>
  
  <pre><code>div.transpose-keys, div#editSong, div#navigation, div#debug{
      display: none;
  }
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>&lt;%= link_to "PRINT", '#', onclick: "printpage()" %&gt;
  </code></pre>
  
  <p>And finally my javascript calling the print function:</p>
  
  <pre><code>function printpage()
    {
    window.print()
    }
  </code></pre>