Hi,
I can't seem to find how to define the format in my links. My link looks like this now:
<%= link_to 'Show', resource_path(@resource) %>
But how do I specify the format? Do I realy need to create the url myself?
Thank you in advance.
Hi,
I can't seem to find how to define the format in my links. My link looks like this now:
<%= link_to 'Show', resource_path(@resource) %>
But how do I specify the format? Do I realy need to create the url myself?
Thank you in advance.
resource_path(@resource, :format => :xml)
Ok, I thought is was this way. But how can I get the url format like
xxx.xml and not like
xxx?format=xml ?
I have
map.connect ':controller/:action/:id.:format'
specified in my routes.rb
Thank you for the quick reply btw
if you do rake routes you should see there are a bunch of additional routes like
formatted_resource_path
you can use those to specify a path to an xml, rss etc file e.g.
link_to('Show XML', formatted_resource_path(@resource, :format => :xml))
Think that should work...
Joe