Rails beginner Rails beginner - 6 months ago 11
Ruby Question

Rails how to rewrite this old route map.connect?

How do I rewrite this old route Rails 1.2.6 to Rails 3? :

# Allow downloading Web Service WSDL as a file with an extension
# instead of a file named 'wsdl'
map.connect ':controller/service.wsdl', :action => 'wsdl'


I canĀ“t see how I should use match route etc.

I have used:

match ':controller/service.wsdl', :action => 'wsdl'


But I dont think it is working correct

Answer

Try this:

match '/controller/service.wsdl' => 'controller#service.wsdl', :as => :wsdl

I'm guessing that your controller is not named controller. If it is, I'd rename it and change the above route as well.

Comments