I'm moving a project from rails 3.1 to rails 3.2.2 and I have this:
= link_to 'CSV', :action => 'list', :search => @search, :format => 'csv'
In rails 3.1 this specifies the format in the html link (format=csv) and it is caught by a respond_with, but in 3.2.2 the format never makes it into the link. I scanned through the list of commits on github and can't find anything that relates to this.
Edit:
Looks like this is an issue with url_for
#rails 3.1
url_for :controller=>'posts', :action=>'index', :format=>:xml
/admin/posts/index?format=xml
#rails 3.2.2
url_for :controller=>'posts', :action=>'index', :format=>:xml
/admin/posts/index
#rails 3.2.2
url_for :controller=>'posts', :action=>'index', :format=>:xml, :id => 5
/admin/posts/index/5.xml
Try using :format => :csv
http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to#32-Link-to-same-URL-with-different-format
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With