rails c增删改查
增:user = User.create(name:'Jack', age:'18')
删:user = User.find_by(name:'Jack')
或 user = User.find_by(age:'18') /*通过该用户区别于其他用户的属性的值,找到该用户*/
user.destroy
改:user = User.find_by(name:'Jack') 或 user = User.find_by(age:'18')
user.update(name:'Rose',age:'17')
或 user.name = 'Rose'
user.age= '17'
user.save