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!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---