Rails not submitting form values
Working on a fairly old app that uses the rails/prototype view helpers/rjs extensively. We have a fairly recurring problem (happens about half a dozen times a week, but usually on the same pages) where the form params are not getting submitted. So from the controllers point of view, the params hash only contains values the router was able to pick up from the route. Looking at the forms themselves, they tend to be fairly basic.
One thing in common is that they use remote_form_for, which actually has some form disabling code that runs after prototype kicks off the ajax. In a few places, it is even more explicit, something like this (uses the ancient syntax, this started as a rails 1 app):
remote_form_for :palle开发者_运维百科t_move,
:row_id => 'new_pallet_move',
:html => {:id => 'new_pallet_move_form'},
:method => :post,
:after => "$('new_pallet_move_form').disable();',
:url => create_many_pallet_moves_path do |f|
in the controller, it is doing something like this
PalletMove.new params[:pallet_move].merge(:move => move)
now, this code works like, 99% of the time. But according to hoptoad, about ten times in the last month, we get NoMethodError: undefined method 'merge' for nil:NilClass
with this as the params {"move_id"=>"908097", "action"=>"create_many", "controller"=>"pallet_moves"}
Just sort of looking to see if people have seen this before, or have any ideas for investigation, cause I am sort of out of ideas.
精彩评论