我有一个带有强大参数的rails 4 app:
def product_params
params.require(:product).permit(:title, :user_id, :info => [:color, :size])
end
但我收到以下错误:
INSERT INTO "products" ("created_at", "info","title", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 15 Apr 2014 01:30:31 UTC +00:00], ["info", [{"color"=>"Blue"}]], ["title", "Shoes"], ["updated_at", Tue, 15 Apr 2014 01:30:31 UTC +00:00]]
TypeError: can't cast Array to json: INSERT INTO "products" ("created_at", "info", "title", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"