mercredi 15 avril 2015

NoMethodError, update_details, in Rails 3.2.21

I make my request AJAX request to add_item_to_contract. The code performs all the actions it needs to update, then we 'respond_to' and the browser receives a 500:



respond_to do |f|
f.html { redirect_to :action => "materials_list", :id => @contract.id }
f.js
end


The first line of the previous code snippet above is line 49 of sales_team_controller. If I comment f.js out, there is no error, but my request doesn't use my RJS template(therefore it doesn't work). The content of the error log for this request includes this error, this error is also returned in a similar form in the Server 500 response(which is a HTML page that can be provided on request):



ActionView::Template::Error (undefined method `update_details' for #<ActionView::LookupContext:0x007f8ec898d830>):
2: # page.select("div#notice").each { |div| div.hide }
3: #END_HIGHLIGHT
4:
5: page.insert_html(:bottom, "materials_for_contract", :partial => "bm_added")
6:
7: if @material
8: div = "material_#{@material.parent_id.nil? ? @material.id : @material.parent_id}"
app/views/sales_team/add_item_to_contract.rjs:5:in `block in _app_views_sales_team_add_item_to_contract_rjs___3966334417793066345_37361160'
app/views/sales_team/add_item_to_contract.rjs:1:in `_app_views_sales_team_add_item_to_contract_rjs___3966334417793066345_37361160'
app/controllers/sales_team_controller.rb:49:in `add_item_to_contract'


I performed a grep on my .rvm directory and I find one instance of update_details:



.rvm/gems/ruby-1.9.3-p551/gems/actionpack-3.2.21/lib/action_view/renderer/abstract_renderer.rb:3: delegate :find_template, :template_exists?, :with_fallbacks, :update_details,


There are multiple instances of update_details in older Rails versions, only one in 3.2.21. Also this instance was removed from Github years ago: http://ift.tt/1IM2AS3


I'm not certain what I should be doing to fix this. I did try to update my copy of abstract_renderer.rb to be similar to what I found on Github but the change in source doesn't seem to propagate to whatever copy of rails I'm actually running.


Aucun commentaire:

Enregistrer un commentaire