I have a set of reports that are displayed in various formats using the Rails call \"respond_to\", such that if the URL ends in CSV or JSON, the report is generated in that
I can finally respond to my own question, now. So here's the answer:
I figured out how this can be accomplished. You can set the name of the buttons to be "format" and set the value to the extension that you would append to the URL.
<%= button_tag( 'HTML', :value => 'html', :name => 'format' ) %>
<%= button_tag( 'CSV', :value => 'csv', :name => 'format' ) %>
<%= button_tag( 'JSON', :value => 'json', :name => 'format' ) %>
Simply changing the params[:format] doesn't work. You have to pass it in before your action runs.