Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined method `to_json' for #<Hash:0x3d3cef0> (NoMethodError) in ActiveSupport 3

Did to_json get removed or something?

like image 540
Travis Reeder Avatar asked Sep 17 '10 00:09

Travis Reeder


1 Answers

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.

like image 190
BaroqueBobcat Avatar answered Oct 15 '22 00:10

BaroqueBobcat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!