vendredi 9 octobre 2015

Params Not In Controller

I have controllers that look like this:

class ApplicationController < ActionController::Base
  before_filter :print_params

  def print_params
   p params
  end
end

class CommandsController < ApplicationController
  before_filter :print_params

  def print_params
   p params
  end
end

class FidelityBondRenewalsController < CommandsController
  before_filter :print_params

  def print_params
   p params
  end

  def renew_with_changes 
     p params
  end
end

When I run my cucumber tests I see print params the whole way through except for when I finally hit the renew_with_changes method and then my params disappear. I have other methods in this controller and it isn't happening to them. I've searched the code base for any differences between the other methods and this one and couldn't find anything.

If I put a binding.pry in the print_params method in the FidelityBondRenewalsController and hit next over and over again, I eventually get to:

    16: def process_action(*args)
    17:   run_callbacks(:process_action, action_name) do
 => 18:     super
    19:   end
    20: end

which has params. If I type next, then I go to my renew_with_changes method and the params are gone.

What can I try to try to track this down? This is a Rails3.2 app, with the strong parameters gem installed to be more like Rails4, if that is useful.

Aucun commentaire:

Enregistrer un commentaire