This project is archived and is in readonly mode.

#4786 ✓resolved
Sam Ruby

render with a partial in rjs fails

Reported by Sam Ruby | June 7th, 2010 @ 04:38 PM | in 3.0.2

page.replace_html('id', render(@product)) in a rjs.js file produces:

ActionView::Template::Error: Missing partial products/product with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:js], :locale=>[:en, :en]} in view paths "/home/rubys/tmp/work-192/testapp/app/views"

Broken by commit http://github.com/rails/rails/commit/5273bd97e6746bd5bdc2450ad5a2d6...

testcase, output, git bisect

Comments and changes to this ticket

  • Sam Ruby

    Sam Ruby June 7th, 2010 @ 05:30 PM

    Full stack trace (from a running server, not a functional test):

    ActionView::Template::Error (Missing partial carts/cart with {:locale=>[:en, :en], :handlers=>[:rhtml, :rxml, :builder, :erb, :rjs], :formats=>[:js]} in view paths "/home/rubys/svn/rails4/Book/util/work/depot/app/views"):
        2: page.select("div#notice").each { |div| div.hide }
        3: #END_HIGHLIGHT
        4: 
        5: page.replace_html('cart', render(@cart))
        6: page[:cart].visual_effect :blind_down if @cart.total_items == 1
        7: page[:current_item].visual_effect :highlight,
        8:                                   :startcolor => "#88ff88",
    /home/rubys/git/rails/actionpack/lib/action_view/paths.rb:14:in `find'
      /home/rubys/git/rails/actionpack/lib/action_view/lookup_context.rb:79:in `find_template'
      /home/rubys/git/rails/actionpack/lib/action_view/base.rb:186:in `__send__'
      /home/rubys/git/rails/actionpack/lib/action_view/base.rb:186:in `find_template'
      /home/rubys/git/rails/actionpack/lib/action_view/render/partials.rb:310:in `find_template'
      /home/rubys/git/rails/actionpack/lib/action_view/render/partials.rb:211:in `render'
      /home/rubys/git/rails/actionpack/lib/action_view/render/partials.rb:332:in `_render_partial'
      /home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:30:in `render'
      /home/rubys/svn/rails4/Book/util/work/depot/app/views/line_items/create.js.rjs:5:in `_render_template_1474244258_70120918619280_0'
      /home/rubys/git/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:154:in `instance_exec'
      /home/rubys/git/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:154:in `initialize'
      /home/rubys/git/rails/actionpack/lib/action_view/helpers/capture_helper.rb:169:in `with_output_buffer'
      /home/rubys/git/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:153:in `initialize'
      /home/rubys/git/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:584:in `new'
      /home/rubys/git/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:584:in `update_page'
      /home/rubys/svn/rails4/Book/util/work/depot/app/views/line_items/create.js.rjs:1:in `_render_template_1474244258_70120918619280_0'
      /home/rubys/git/rails/actionpack/lib/action_view/template.rb:134:in `send'
      /home/rubys/git/rails/actionpack/lib/action_view/template.rb:134:in `render'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:48:in `__send__'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:48:in `instrument'
      /home/rubys/git/rails/actionpack/lib/action_view/template.rb:126:in `render'
      /home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:58:in `_render_template'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:48:in `__send__'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:48:in `instrument'
      /home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:55:in `_render_template'
      /home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:25:in `render'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `_render_template'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:108:in `render_to_body'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:101:in `render_to_string'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:92:in `render'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:17:in `render'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
      /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/benchmark.rb:308:in `realtime'
      /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:77:in `cleanup_view_runtime'
      /home/rubys/git/rails/activerecord/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:38:in `render'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:145:in `process_action'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:438:in `_run__1833224143__process_action__1623385099__callbacks'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:408:in `send'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:408:in `_run_process_action_callbacks'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:88:in `send'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:88:in `run_callbacks'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:48:in `__send__'
      /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:48:in `instrument'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:28:in `process_action'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:8:in `process_action'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:114:in `process'
      /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:126:in `dispatch'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
      /home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:166
      /home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-mount-0.6.3/lib/rack/mount/route_set.rb:148:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-mount-0.6.3/lib/rack/mount/code_generation.rb:89:in `recognize'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-mount-0.6.3/lib/rack/mount/code_generation.rb:199:in `optimized_each'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-mount-0.6.3/lib/rack/mount/code_generation.rb:88:in `recognize'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-mount-0.6.3/lib/rack/mount/route_set.rb:139:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:454:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:177:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:106:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:235:in `call'
      /home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
      /home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
      /home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:11:in `cache'
      /home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:30:in `call'
      /home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:365:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:414:in `_run_call_callbacks'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:88:in `send'
      /home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:88:in `run_callbacks'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/sendfile.rb:105:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:48:in `call'
      /home/rubys/git/rails/railties/lib/rails/rack/logger.rb:14:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/runtime.rb:17:in `call'
      /home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
      /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
      /home/rubys/git/rails/railties/lib/rails/application.rb:145:in `call'
      /home/rubys/git/rails/railties/lib/rails/application.rb:81:in `send'
      /home/rubys/git/rails/railties/lib/rails/application.rb:81:in `method_missing'
      /home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:15:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:162:in `start'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:95:in `start'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:92:in `each'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:92:in `start'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:23:in `start'
      /home/rubys/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/webrick/server.rb:82:in `start'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in `run'
      /home/rubys/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/server.rb:155:in `start'
      /home/rubys/git/rails/railties/lib/rails/commands/server.rb:62:in `start'
      /home/rubys/git/rails/railties/lib/rails/commands.rb:30
      /home/rubys/git/rails/railties/lib/rails/commands.rb:27:in `tap'
      /home/rubys/git/rails/railties/lib/rails/commands.rb:27
      script/rails:6:in `require'
      script/rails:6
    
    Rendered /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
    Rendered /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (7.9ms)
    Rendered /home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (11.7ms)
    
  • Repository

    Repository June 7th, 2010 @ 09:23 PM

    • State changed from “open” to “resolved”

    (from [981f81275be8e0f38a35c397b41a209b0e14973c]) Fix case when rendering a partial inside RJS with inherited layout [#4786 state:resolved] http://github.com/rails/rails/commit/981f81275be8e0f38a35c397b41a20...

  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages