Robert Brown
Robert Brown

Reputation: 11016

link_to xml request

Here's my current hack:

<%= link_to "Retrieve as XML", products_path + ".xml" %>

...which works just fine, but is obviously quite ugly.

What is the proper way?

I searched the docs for an answer - no luck. Some old forum posts suggest there is (or was) a format option, but it seems this is no longer available.

Upvotes: 4

Views: 753

Answers (1)

Chirantan
Chirantan

Reputation: 15634

<%= link_to "Retrieve as XML", products_path(:format => 'xml') %>

Upvotes: 8

Related Questions