Mysql2::Error: Incorrect string value

后端 未结 7 1602
青春惊慌失措
青春惊慌失措 2021-01-29 23:30

I have a rails application running on production mode, but all of the sudden this error came up today when a user tried to save a record.



        
7条回答
  •  太阳男子
    2021-01-30 00:08

    Also, if you don't want to do changes in your database structure, you could opt by serializing the field in question.

    class MyModel < ActiveRecord::Base
      serialize :content
    
      attr_accessible :content, :title
    end
    

提交回复
热议问题