views:

132

answers:

1

I'm setting up some link_to xml views within a rails app. How can the url display the .xml extension?

Need it to appear as:
http://localhost:3000/test/1-testing.xml

Currently it appears as:
http://localhost:3000/test/1-testing
A: 

Assuming you want to link to the instance @test, try:

test_url(@test, :format => :xml)
ry
This is my link code: <%= link_to 'Map', {:action => 'map', :id => entry, :format => :xml} %>And it displays as:http://localhost:3000/entries/map/1-sample-form?format=xmlAnd it needs to be:http://localhost:3000/entries/map/1-sample-form.xml
Jeffrey