Rails link_to :format => :xlsx not generating link to .xlsx path
Your link_to
and path
are slightly off. You want
<%= link_to('Export to Excel', reports_affirmative_action_path(format: :xlsx)) %>
Where the format is an argument to the path
helper, not link_to
.