Rails 控制台命令

t=Topic.find(123)
t.title=‘my new title’
t.save

or

t.update(title: ‘my new title’)

Thanks. One thing I couldn’t figue out was how to assign a value with a value pulled from somewhere e.g.

t.update(title: topic2.find(123).title)

1 个赞