I'm assuming that you are using the pdf
format to determine if the user wants a pdf version. You can check if the request format is pdf in your view
<% unless request.format.to_sym == :pdf %>
<%= link_to 'Download PDF', { format: :pdf } %>
<% end %>