25 Jul 2022   rails


#url_for takes a Hash of options to change the format:

<%= link_to "Final Invoice", [:final_invoice, ticket, {format: :pdf}] %>
<a href="/tickets/123/final-invoice.pdf">Final Invoice</a>