Hello All,
I''m trying to figure out how respond_to actually works, especially with
the increased focus on REST.
After I set a MIME type for Excel
Mime::Type.register "application/vnd.ms-excel", :xls
In my index action''s respond_to block
I have format.xls {
@parts = Part.find(:all)
headers[''Content-Type''] =
"application/vnd.ms-excel"
headers[''Content-Disposition''] = "attachment;
filename=\"parts-inventory-#{Time.now.strftime("%m-%d-%Y")}.xls\""
headers[''Cache-Control''] = ''''
render( :action=>"inbound.rxml", :layout => false)
}
but how do i actually trigger the action to return the spreadsheet
instead of the HTML page?
when i try index.xls it tries to render the show function.
If anyone can explain this that would be much appreciated.
Binh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---