⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
def show_pdf | |
@order = Order.find_by_token(params[:id]) | |
if @order.nil? | |
flash[:error] = "Couldn't find invoice." | |
redirect_to root_path | |
else | |
pdf = PDFKit.new(render_to_string(:action => 'show', :id => @order.token, :layout => "invoice")) | |
pdf.stylesheets << "#{Rails.root}/public/stylesheets/invoice.css" |