我有一个页面上有一个大图,当你使用它时,网址中有很多参数。
所以我的控制器看起来像这样:
def report # gather data for report respond_to do |format| format.html format.xls { send_xls_file(@campaigns.uniq) } format.csv { send_csv_file(@campaigns.uniq)} end def send_xls_file(campaigns) @campaigns = campaigns report_name = "CampaignReport.xls" response.headers["Content-Disposition"] = "attachment; filename=#{report_name}" end # send csv does is similar but creates a csv using fastercsv.在xls的视图中,我创建了excel doc
现在,当我在页面上有一个很长的URL并调用xls或csv时,我收到此错误:
Completed in 3189ms (View: 894, DB: 108) | 200 OK [https://myapp.com/campaign_metrics/report?mycampia%5B%5D=White+Paper+1&mycampia%5B%5D=Talk+Turkey+-+T&mycampia%5B%5D=Nicole+Book+-+T&mycampia%5B%5D=Make+the+Case+-+T&mycampia%5B%5D=Make+the+Case+-+L&mycampia%5B%5D=Make+the+Case+-+F&mycampia%5B%5D=Learn+Sewings+-+T&mycampia%5B%5D=Learn+Sewings+-+L&mycampia%5B%5D=Learn+Sewings+-+F&mycampia%5B%5D=Keys+-+T&mycampia%5B%5D=Keys+-+L&mycampia%5B%5D=Keys+-+F&mycampia%5B%5D=How+to+Tie+-+F&mycampia%5B%5D=Cartoon&mycampia%5B%5D=Best+Practice+SM+-+FB&mycampia%5B%5D=5+Reasons+Flat+-+T&mycampia%5B%5D=5+Reasons+Flat+-+L&top_mycampia%5B%5D=678&top_mycampia%5B%5D=681&top_mycampia%5B%5D=682&top_mycampia%5B%5D=683&top_mycampia%5B%5D=685&top_mycampia%5B%5D=686&top_mycampia%5B%5D=687&top_mycampia%5B%5D=688&top_mycampia%5B%5D=689&top_mycampia%5B%5D=690&top_mycampia%5B%5D=691&top_mycampia%5B%5D=692&top_mycampia%5B%5D=693&top_mycampia%5B%5D=694&top_mycampia%5B%5D=695&top_mycampia%5B%5D=696&top_mycampia%5B%5D=697&top_mycampia%5B%5D=698&top_mycampia%5B%5D=699&top_mycampia%5B%5D=700&top_mycampia%5B%5D=701&top_mycampia%5B%5D=702&top_mycampia%5B%5D=703&top_mycampia%5B%5D=704&top_mycampia%5B%5D=705&top_mycampia%5B%5D=706&top_mycampia%5B%5D=707&top_mycampia%5B%5D=709&top_mycampia%5B%5D=710&top_mycampia%5B%5D=722&top_mycampia%5B%5D=723&top_mycampia%5B%5D=724&top_mycampia%5B%5D=725&top_mycampia%5B%5D=726&top_mycampia%5B%5D=728&top_mycampia%5B%5D=729&top_mycampia%5B%5D=730&top_mycampia%5B%5D=731&top_mycampia%5B%5D=732&top_mycampia%5B%5D=733&top_mycampia%5B%5D=734&top_mycampia%5B%5D=735&top_mycampia%5B%5D=736&top_mycampia%5B%5D=737&top_mycampia%5B%5D=738&top_mycampia%5B%5D=739&top_mycampia%5B%5D=740&date_select_range=7%2F1%2F2012+-+12%2F31%2F2012&submit_action=Submit&graph_option=monthly&mycampia%5B%5D=White+Paper+1&mycampia%5B%5D=Talk+Turkey+-+T&mycampia%5B%5D=Nicole+Book+-+T&mycampia%5B%5D=Make+the+Case+-+T&mycampia%5B%5D=Make+the+Case+-+L∓mycampia%5B%5D=Make+the+Case+-+F&mycampia%5B%5D=Learn+Sewings+-+T&mycampia%5B%5D=Learn+Sewings+-+L&mycampia%5B%5D=Learn+Sewings+-+F&mycampia%5B%5D=Keys+-+T&mycampia%5B%5D=Keys+-+L&mycampia%5B%5D=Keys+-+F&mycampia%5B%5D=How+to+Tie+-+F&mycampia%5B%5D=Cartoon&mycampia%5B%5D=Best+Practice+SM+-+FB&mycampia%5B%5D=5+Reasons+Flat+-+T&mycampia%5B%5D=5+Reasons+Flat+-+L&date_select_range=7%2F1%2F2012+-+12%2F31%2F2012&format=xls&graph_option=monthly&graphtype=Actual&report_type=export&sort=campaign&submit_action=Submit&top_mycampia%5B%5D=678&top_mycampia%5B%5D=681&top_mycampia%5B%5D=682&top_mycampia%5B%5D=683&top_mycampia%5B%5D=685&top_mycampia%5B%5D=686&top_mycampia%5B%5D=687&top_mycampia%5B%5D=688&top_mycampia%5B%5D=689&top_mycampia%5B%5D=690&top_mycampia%5B%5D=691&top_mycampia%5B%5D=692&top_mycampia%5B%5D=693&top_mycampia%5B%5D=694&top_mycampia%5B%5D=695&top_mycampia%5B%5D=696&top_mycampia%5B%5D=697&top_mycampia%5B%5D=698&top_mycampia%5B%5D=699&top_mycampia%5B%5D=700&top_mycampia%5B%5D=701&top_mycampia%5B%5D=702&top_mycampia%5B%5D=703&top_mycampia%5B%5D=704&top_mycampia%5B%5D=705&top_mycampia%5B%5D=706&top_mycampia%5B%5D=707&top_mycampia%5B%5D=709&top_mycampia%5B%5D=710&top_mycampia%5B%5D=722&top_mycampia%5B%5D=723&top_mycampia%5B%5D=724&top_mycampia%5B%5D=725&top_mycampia%5B%5D=726&top_mycampia%5B%5D=728&top_mycampia%5B%5D=729&top_mycampia%5B%5D=730&top_mycampia%5B%5D=731&top_mycampia%5B%5D=732&top_mycampia%5B%5D=733&top_mycampia%5B%5D=734&top_mycampia%5B%5D=735&top_mycampia%5B%5D=736&top_mycampia%5B%5D=737&top_mycampia%5B%5D=738&top_mycampia%5B%5D=739&top_mycampia%5B%5D=740&visits=on] /!\ FAILSAFE /!\ Thu Jan 03 12:33:51 +0000 2013 Status: 500 Internal Server Error ActionController::Session::CookieStore::CookieOverflow /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:102:in `call' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call' /usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' /usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb:470:in `safe_fork' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:180:in `start' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/helper-scripts/passenger-spawn-server:99我不是故意在我的会话中存储任何内容,看起来rails可能会将url放入会话并且它太大了? 有任何想法吗?
I have a page with a big graph on it with lots of params in the url when you work with it a bunch.
So my controller looks something like this:
def report # gather data for report respond_to do |format| format.html format.xls { send_xls_file(@campaigns.uniq) } format.csv { send_csv_file(@campaigns.uniq)} end def send_xls_file(campaigns) @campaigns = campaigns report_name = "CampaignReport.xls" response.headers["Content-Disposition"] = "attachment; filename=#{report_name}" end # send csv does is similar but creates a csv using fastercsv.In the view for xls I create the excel doc
Now when I have a very long url on the page and call either xls or csv, I get this error:
Completed in 3189ms (View: 894, DB: 108) | 200 OK [https://myapp.com/campaign_metrics/report?mycampia%5B%5D=White+Paper+1&mycampia%5B%5D=Talk+Turkey+-+T&mycampia%5B%5D=Nicole+Book+-+T&mycampia%5B%5D=Make+the+Case+-+T&mycampia%5B%5D=Make+the+Case+-+L&mycampia%5B%5D=Make+the+Case+-+F&mycampia%5B%5D=Learn+Sewings+-+T&mycampia%5B%5D=Learn+Sewings+-+L&mycampia%5B%5D=Learn+Sewings+-+F&mycampia%5B%5D=Keys+-+T&mycampia%5B%5D=Keys+-+L&mycampia%5B%5D=Keys+-+F&mycampia%5B%5D=How+to+Tie+-+F&mycampia%5B%5D=Cartoon&mycampia%5B%5D=Best+Practice+SM+-+FB&mycampia%5B%5D=5+Reasons+Flat+-+T&mycampia%5B%5D=5+Reasons+Flat+-+L&top_mycampia%5B%5D=678&top_mycampia%5B%5D=681&top_mycampia%5B%5D=682&top_mycampia%5B%5D=683&top_mycampia%5B%5D=685&top_mycampia%5B%5D=686&top_mycampia%5B%5D=687&top_mycampia%5B%5D=688&top_mycampia%5B%5D=689&top_mycampia%5B%5D=690&top_mycampia%5B%5D=691&top_mycampia%5B%5D=692&top_mycampia%5B%5D=693&top_mycampia%5B%5D=694&top_mycampia%5B%5D=695&top_mycampia%5B%5D=696&top_mycampia%5B%5D=697&top_mycampia%5B%5D=698&top_mycampia%5B%5D=699&top_mycampia%5B%5D=700&top_mycampia%5B%5D=701&top_mycampia%5B%5D=702&top_mycampia%5B%5D=703&top_mycampia%5B%5D=704&top_mycampia%5B%5D=705&top_mycampia%5B%5D=706&top_mycampia%5B%5D=707&top_mycampia%5B%5D=709&top_mycampia%5B%5D=710&top_mycampia%5B%5D=722&top_mycampia%5B%5D=723&top_mycampia%5B%5D=724&top_mycampia%5B%5D=725&top_mycampia%5B%5D=726&top_mycampia%5B%5D=728&top_mycampia%5B%5D=729&top_mycampia%5B%5D=730&top_mycampia%5B%5D=731&top_mycampia%5B%5D=732&top_mycampia%5B%5D=733&top_mycampia%5B%5D=734&top_mycampia%5B%5D=735&top_mycampia%5B%5D=736&top_mycampia%5B%5D=737&top_mycampia%5B%5D=738&top_mycampia%5B%5D=739&top_mycampia%5B%5D=740&date_select_range=7%2F1%2F2012+-+12%2F31%2F2012&submit_action=Submit&graph_option=monthly&mycampia%5B%5D=White+Paper+1&mycampia%5B%5D=Talk+Turkey+-+T&mycampia%5B%5D=Nicole+Book+-+T&mycampia%5B%5D=Make+the+Case+-+T&mycampia%5B%5D=Make+the+Case+-+L&mycampia%5B%5D=Make+the+Case+-+F&mycampia%5B%5D=Learn+Sewings+-+T&mycampia%5B%5D=Learn+Sewings+-+L&mycampia%5B%5D=Learn+Sewings+-+F&mycampia%5B%5D=Keys+-+T&mycampia%5B%5D=Keys+-+L&mycampia%5B%5D=Keys+-+F&mycampia%5B%5D=How+to+Tie+-+F&mycampia%5B%5D=Cartoon&mycampia%5B%5D=Best+Practice+SM+-+FB&mycampia%5B%5D=5+Reasons+Flat+-+T&mycampia%5B%5D=5+Reasons+Flat+-+L&date_select_range=7%2F1%2F2012+-+12%2F31%2F2012&format=xls&graph_option=monthly&graphtype=Actual&report_type=export&sort=campaign&submit_action=Submit&top_mycampia%5B%5D=678&top_mycampia%5B%5D=681&top_mycampia%5B%5D=682&top_mycampia%5B%5D=683&top_mycampia%5B%5D=685&top_mycampia%5B%5D=686&top_mycampia%5B%5D=687&top_mycampia%5B%5D=688&top_mycampia%5B%5D=689&top_mycampia%5B%5D=690&top_mycampia%5B%5D=691&top_mycampia%5B%5D=692&top_mycampia%5B%5D=693&top_mycampia%5B%5D=694&top_mycampia%5B%5D=695&top_mycampia%5B%5D=696&top_mycampia%5B%5D=697&top_mycampia%5B%5D=698&top_mycampia%5B%5D=699&top_mycampia%5B%5D=700&top_mycampia%5B%5D=701&top_mycampia%5B%5D=702&top_mycampia%5B%5D=703&top_mycampia%5B%5D=704&top_mycampia%5B%5D=705&top_mycampia%5B%5D=706&top_mycampia%5B%5D=707&top_mycampia%5B%5D=709&top_mycampia%5B%5D=710&top_mycampia%5B%5D=722&top_mycampia%5B%5D=723&top_mycampia%5B%5D=724&top_mycampia%5B%5D=725&top_mycampia%5B%5D=726&top_mycampia%5B%5D=728&top_mycampia%5B%5D=729&top_mycampia%5B%5D=730&top_mycampia%5B%5D=731&top_mycampia%5B%5D=732&top_mycampia%5B%5D=733&top_mycampia%5B%5D=734&top_mycampia%5B%5D=735&top_mycampia%5B%5D=736&top_mycampia%5B%5D=737&top_mycampia%5B%5D=738&top_mycampia%5B%5D=739&top_mycampia%5B%5D=740&visits=on] /!\ FAILSAFE /!\ Thu Jan 03 12:33:51 +0000 2013 Status: 500 Internal Server Error ActionController::Session::CookieStore::CookieOverflow /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:102:in `call' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call' /usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' /usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb:470:in `safe_fork' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:180:in `start' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously' /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.17/helper-scripts/passenger-spawn-server:99I am not intentionally storing anything in my sessions, it seems like rails is maybe putting the url into the session and its too big? Any ideas?
最满意答案
看起来有些东西正在存储会话中的长网址 - 可能是清除? - 这就是造成你的问题。
Looks like something is storing the long url in the session - possible Clearance? - and that is causing your problem.
更多推荐
发布评论