I am following a tutorial from railscast (http://railscasts.com/episodes/220-pdfkit) and have become stuck when trying to implement the link for a PDF. The original code was:
<p id="pdf_link"><%= link_to "Download Invoice (PDF)", order_path(@order, :format => "pdf") %></p>
I am however using haml so I have edited the line as follows:
= link_to 'Download PDF', order_path(@order, :format => "pdf")
I have realised that order_path would relate to a route specified in routes.rb. The problem is my application does not have a route folder (inherited the application from another developer). Therefore how would i go about creating this path in haml code.
Also I was wondering about replacing @order. In looking through the code i noticed it is declared as such. Could someone explain what this piece of code declares order as?
@order = Order.find(params[:id])