Reputation: 4895
I'm validating on one stage
params[:user][:address]
But there are times when params[:user]
are not set. What should I use to check against this? blank?
, nil?
, or present?
? The objective is to make this check on as few lines as possible.
Upvotes: 0
Views: 446
Reputation: 30445
unless params[:user] && params[:user][:address].present?
# do something
end
Upvotes: 1