ruby on rails - undefined method `each` for nil:NilClass -


i have following code , getting error of "undefined method each' nil:nilclass"

@loan_ids = params[:moredata].split(",").map { |s| s.to_i } @loans_ids.each |number|   puts number end 

its @loan_ids.each not @loans_ids.each


Comments