Question

My Rails action stops rendering the response after the same amount of data transmitted. No error or warning is shown.

At first, I thought that my partial could be a cause of that but then I removed the partial call and inserted some plain text instead and the result html was still getting chopped depending on how much text I insert.

I tried it with thin, webrick and pow + nginx.

It looks as if it had some kind of response size limit somewhere. Any ideas?

UPDATE:

The render fails on the particular code (even if I empty the _offer partial):

# 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

UPDATE 2:

It starts working if I remove everything below .exclusive_content_photo= image_tag offer.package.hotel.main_image_path (incl. this line)

UPDATE 3:

Any call to offer.package causes it to crash. In console everything works fine.

=========

My gem list:

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)
Was it helpful?

Solution

Bullet gem was the cause of it. For more information see https://github.com/rails/rails/issues/8283

OTHER TIPS

You seem to be using 'offers' instead of '@offers' in your views. Other than that I've had issues with HAML skimping out on error messages caused by Ruby code in the views. Are you sure that the object returned by the controller has all the data being used by the view? In your controller after you fetch the offers try putting in

puts @offers.inspect

and look in your server log to see this object has the info you expect

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top