In Rails 3, assuming your path is foo_path , you want:
foo_path(:format=>:xml)
In link_to you can do
link_to "link text", foo_path(:format => :xml)
And with additional options:
link_to "link text", foo_path(:format => :xml), :id=>"foo_id", :class=>"foo_class"
(This question is old as hell, but I thought I would answer to help anyone who finds this through Google, like me.)
Grant birchmeier
source share