I have this simple rails code and something weird is happening. As you can see params.nil?
is true
and it's still calling the else part. What am I missing here?
Pry Session
5: def build_resource
6: binding.pry
7: if params.nil?
8: model_class.new
9: else
=> 10: params = params.merge(dealer: {})
11: model_class.new(dealer_params)
12: end
13: end
[3] pry(#<Admin::DealersController>):1> params.nil?
true
So, this answer my question (https://stackoverflow.com/a/1335890):