RESTful routes and Mime::Type

Hi all

I’m using RESTful routes combined with the to_csv plugin and would
like to know if there’s a nicer way of generating a link to fetch the
CSV file than just making a hard link. This is what I use for the
moment (and it works btw):

<%= link_to(“Export as CSV”,"/companies.csv") -%>

I would expect the link helper to have something like

<%= link_to(“Export as CSV”,companies_url(:type => :csv) -%>

but haven’t found anything in the rails docs to generate the URL in
this way.

Best regards

Peter De Berdt

On 1/16/07, Peter De Berdt [email protected] wrote:

<%= link_to(“Export as CSV”,companies_url(:type => :csv) -%>

but haven’t found anything in the rails docs to generate the URL in this
way.

formatted_companies_url(:format => :csv)


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com

On 16 Jan 2007, at 15:45, Rick O. wrote:

I would expect the link helper to have something like

<%= link_to(“Export as CSV”,companies_url(:type => :csv) -%>

but haven’t found anything in the rails docs to generate the URL
in this
way.

formatted_companies_url(:format => :csv)

Thanks! Working perfectly, simple… but undocumented.

Best regards

Peter De Berdt

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs