Hey all,
Here is the suspect code, description follows.
environment:
Mime::Type.register "text/csv", :csv
controller:
def sales_report
...
...
respond_to do |f|
f.csv { send_data(csvify(@sales), :filename => "sales-report--
#{@period}.csv") }
f.html { render(:layout => "sales_report") }
end
end
view:
form tag to generate the report -
form_for(:film_id, :html => {:method => "GET"}, :url =>
formatted_member_sales_report_path(:user_id => @user.id, :id =>
@account.id, :format => "html"))
link to download generated report as CSV file:
link_to("Download CSV Report",
formatted_member_sales_report_path(:user_id => @user.id, :id =>
@account.id, :format => "csv"))
First of all this is in rails 1.2.3 (yes upgrade is in the works:-).
The weirdness is that everything works perfectly on my local dev box
and our test server running in either development or production mode.
But on our live production box it will only return the HTML page and
never the CSV download.
The only significant differences between the boxes are that we''re
running mod_rails on both my local dev box and the test server but
mongrels on the live/production box. Could that be it? Seems to me
there must be something else going on.
Any thoughts greatly appreciated,
Tim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---