undefined method `to_json' for #<Hash:0x3d3cef0> (NoMethodError) in ActiveSupport 3
-
03-10-2019 - |
Question
Did to_json get removed or something?
Solution
Try adding require "active_support/core_ext"
require 'active_support'
doesn't inject behavior into the core classes by itself. That way you can pick which extensions you want. Using core_ext
dumps the extensions you are familiar with from rails into the core classes.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow