Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想自定义插入到控制器列中的值,并且我想在其中插入一个空值。这样 :
@users.to = null
我相信你想要:
@user.to = nil
您可能必须运行迁移以确保该列允许 NULL 值:
change_column :users, :to, :string, :null => true