2012-11-20 24 views
0

我的Rails操作停止在傳輸相同數量的數據後呈現響應。沒有顯示錯誤或警告。Rails響應在某些時候被省略

起初,我認爲我的部分可能是一個原因,但後來我刪除了部分調用,並插入一些純文本,而結果HTML仍然被切碎取決於我插入多少文本。我試過thin,webrickpow + nginx

它看起來好像在某種地方有某種響應大小的限制。有任何想法嗎?

UPDATE:

# Controller: 
@offers = Offer.all 

# View: 
<% offers.each do |offer| %> 
<%= render offer %> 
<% end %> 

# views/offers/_offer.html.haml 
%li{ :class => offer.promo_type } 
.content_card 
    .content_item_wrapper 
     .exclusive_content_ribbon 
     .exlusive_glossy 
     .exclusive_operator 
      .operator_icon 
     .exclusive_content_photo= image_tag offer.package.hotel.main_image_path 
     .exclusive_content_hotel 
      .ex_hotel_stars 
       %span{ :class => ["ex_hotel_stars_b", "star_#{offer.package.hotel.stars}"] } 
      .ex_hotel_name 
       %a= offer.package.hotel.name 
      .ex_hotel_place 
       %span.ex_hotel_place_country= offer.package.hotel.country.name_ru 
       &#8250; 
       %span.ex_hotel_place_region= offer.package.hotel.city.name_ru 

更新2::

渲染特定代碼(即使我清空_offer局部的)失敗

它開始工作,如果我刪除下面的所有內容.exclusive_content_photo= image_tag offer.package.hotel.main_image_path(含該行)

UPDATE 3:

任何呼叫offer.package都會導致其崩潰。在控制檯中一切正常。

=========

我的寶石列表:

 
Gems included by the bundle: 
    * aasm (3.0.14) 
    * actionmailer (3.2.9) 
    * actionpack (3.2.9) 
    * activeadmin (0.5.0 eea827a) 
    * activemodel (3.2.9) 
    * activerecord (3.2.9) 
    * activeresource (3.2.9) 
    * activesupport (3.2.9) 
    * addressable (2.3.2) 
    * ansi (1.4.3) 
    * arbre (1.0.1) 
    * arel (3.0.2) 
    * aws-sdk (1.7.1) 
    * bcrypt-ruby (3.0.1) 
    * bourbon (2.1.2) 
    * builder (3.0.4) 
    * bullet (4.2.0 c292bb7) 
    * bundler (1.2.1) 
    * cancan (1.6.8) 
    * capistrano (2.13.5) 
    * capybara (1.1.3) 
    * celluloid (0.12.3) 
    * childprocess (0.3.6) 
    * chronic (0.8.0) 
    * clickatell (0.8.2 62d215c) 
    * coderay (1.0.8) 
    * coffee-rails (3.2.2) 
    * coffee-script (2.2.0) 
    * coffee-script-source (1.4.0) 
    * connection_pool (0.9.2) 
    * css_parser (1.2.6) 
    * daemons (1.1.9) 
    * devise (2.1.2) 
    * diff-lcs (1.1.3) 
    * domain_name (0.5.4) 
    * erubis (2.7.0) 
    * eventmachine (1.0.0) 
    * exception_notification (3.0.0) 
    * execjs (1.4.0) 
    * facter (1.6.14) 
    * factory_girl (4.1.0) 
    * factory_girl_rails (4.1.0) 
    * fancybox-rails (0.1.4) 
    * faraday (0.8.4) 
    * faraday_middleware (0.9.0) 
    * fastercsv (1.5.5) 
    * faye-websocket (0.4.6) 
    * ffi (1.2.0) 
    * formtastic (2.2.1) 
    * god (0.13.1) 
    * guard (1.5.4) 
    * guard-rspec (2.1.2) 
    * haml (3.1.7) 
    * has_scope (0.5.1) 
    * hashie (1.2.0) 
    * highline (1.6.15) 
    * hike (1.2.1) 
    * http_parser.rb (0.5.3) 
    * httparty (0.9.0) 
    * i18n (0.6.1) 
    * inherited_resources (1.3.1) 
    * jbuilder (0.8.2) 
    * journey (1.0.4) 
    * jquery-rails (2.1.3) 
    * json (1.7.5) 
    * kaminari (0.14.1) 
    * kgio (2.7.4) 
    * launchy (2.1.2) 
    * letter_opener (1.0.0) 
    * libv8 (3.3.10.4) 
    * libwebsocket (0.1.6.1) 
    * libxml-ruby (2.3.3) 
    * listen (0.5.3) 
    * lumberjack (1.0.2) 
    * mail (2.4.4) 
    * markerb (1.0.0) 
    * mechanize (2.5.1) 
    * meta_search (1.1.3) 
    * method_source (0.8.1) 
    * mime-types (1.19) 
    * mini_magick (3.4) 
    * multi_json (1.3.7) 
    * multi_xml (0.5.1) 
    * multipart-post (1.1.5) 
    * mysql2 (0.3.11) 
    * net-http-digest_auth (1.2.1) 
    * net-http-persistent (2.8) 
    * net-scp (1.0.4) 
    * net-sftp (2.0.5) 
    * net-ssh (2.6.1) 
    * net-ssh-gateway (1.1.0) 
    * newrelic_rpm (3.5.2.17) 
    * nokogiri (1.5.5) 
    * ntlm-http (0.1.1) 
    * orm_adapter (0.4.0) 
    * poltergeist (1.0.2) 
    * polyamorous (0.5.0) 
    * polyglot (0.3.3) 
    * pry (0.9.10) 
    * rack (1.4.1) 
    * rack-cache (1.2) 
    * rack-protection (1.2.0) 
    * rack-ssl (1.3.2) 
    * rack-test (0.6.2) 
    * rails (3.2.9) 
    * railties (3.2.9) 
    * raindrops (0.10.0) 
    * rake (10.0.2) 
    * rb-fsevent (0.9.2) 
    * rdoc (3.12) 
    * redcarpet (2.2.2) 
    * redis (3.0.2) 
    * redis-actionpack (3.2.3) 
    * redis-activesupport (3.2.3) 
    * redis-namespace (1.2.1) 
    * redis-rack (1.4.2) 
    * redis-rails (3.2.3) 
    * redis-store (1.1.3) 
    * responders (0.9.3) 
    * roadie (2.3.4) 
    * rspec (2.12.0) 
    * rspec-core (2.12.0) 
    * rspec-expectations (2.12.0) 
    * rspec-mocks (2.12.0) 
    * rspec-nc (0.0.4) 
    * rspec-rails (2.12.0) 
    * rubyzip (0.9.9) 
    * russian (0.6.0) 
    * sass (3.2.3) 
    * sass-rails (3.2.5) 
    * sax-machine (0.1.0) 
    * selenium-webdriver (2.26.0) 
    * sendgrid (1.1.0) 
    * sidekiq (2.5.3) 
    * simple_oauth (0.1.9) 
    * sinatra (1.3.3) 
    * slim (1.3.4) 
    * slop (3.3.3) 
    * sprockets (2.2.1) 
    * subexec (0.2.2) 
    * temple (0.5.5) 
    * terminal-notifier (1.4.2) 
    * therubyracer (0.10.2) 
    * thin (1.5.0) 
    * thor (0.16.0) 
    * tilt (1.3.3) 
    * timers (1.0.1) 
    * tinder (1.9.1) 
    * treetop (1.4.12) 
    * turbo-sprockets-rails3 (0.3.2) 
    * turn (0.9.6) 
    * twitter-stream (0.1.16) 
    * typhoeus (0.4.2) 
    * tzinfo (0.3.35) 
    * uglifier (1.3.0) 
    * unf (0.0.5) 
    * unf_ext (0.0.5) 
    * unicorn (4.4.0) 
    * uniform_notifier (1.1.0) 
    * uuidtools (2.1.3) 
    * warden (1.2.1) 
    * webrobots (0.0.13) 
    * websocket (1.0.3) 
    * whenever (0.8.0) 
    * xpath (0.1.4) 
    * yaml_db (0.2.3) 
+0

任何錯誤信息?或代碼顯示? – scaryguy

+0

@scaryguy更新上面 – Fenelon

回答

0

你似乎使用的,而不是在你的觀點 '@offers' 報價'。除此之外,我還遇到過HAML剔除視圖中由Ruby代碼引起的錯誤消息的問題。你確定控制器返回的對象是否有視圖使用的所有數據?在您的控制器後,您將獲取報價嘗試把在

puts @offers.inspect 

,並期待在你的服務器日誌,看看這個對象有你期望