I have this code in the controller:
def search2 @repair_tickets = RepairTicket.search(params[:search][:client_id],params[:search][:product_id],params[:search][:status_id],params[:search][:pos_breakdown_id],params[:search][:breakdown_id],params[:search][:query]) respond_to do |format| format.html format.pdf do send_data SearchRepairTicketDrawer.draw(@repair_tickets), :filename => 'repair_tickets/search2/@repair_tickets.pdf', :type => 'application/pdf', :disposition => 'inline' end end end
And I have this code in search2.html.erb:
...
<p> <%= link_to 'PDF Format', formatted_repair_ticket_path(@repair_tickets, :pdf) %> </p>
I want this last link to link to the pdf wich I create in search2 method. If I quit the format.html line, it generates the pdf I want, but i want a link to do it. Help!