Zauvohi/app_radio — pull request #5 by Zauvohi (2014-06-23 16:55:26+00:00)
Title: PDF feature

This adds the ability to create PDF files of the messages and view/download them.

They generated PDFs keep almost the same style as showed in the browser, here's a link to an example https://dl.dropboxusercontent.com/u/25272651/message_no_555.pdf

Here's a quick list of what has been done:

*Add wicked_pdf gem to generate the PDFs.
*Add a new template for the PDFs, this is a slightly edited copy of the show view (I couldn't use the same view because there were some compatibility issues with some bootstrap elements)
*Edit the show method to respond to PDFs.
*Add a link to view the PDF of the displayed message and little javascript to craft the URL.

Other notes:

I tried to add a method to download the file but it proved to be more trouble that it was worth, also the PDF viewer will let the user download the file so I felt it was redundant, and if for some reason the user's browser doesn't have a PDF viewer installed, then it will download the PDF file.