Right now I have a method like this:
def estados
respond_to do |format|
format.html
format.xls do
# generate xls and send it with send_data
end
end
end
in my routes.rb I’ve changed the default route to this:
map.connect ‘:controller/:action/:id.:format’
And in environment.rb, I added this line:
Mime::Type.register “application/vnd.ms-excel”, :xls
However, when I use the new default route, none of my
controllers/actions is recognized, and I get this error:
Routing Error
no route found to match “/informes/estados” with {:method=>:get}
What’s the right way to use the respond_to method?
Thanks for any tip.
Regards,
Rolando.-