fields for books table: id, name
fields for records table:id, name, status
I would like to insert value ‘read’ to status field in records table
when name matches name in books table. Tried the following but no luck.
I would appreciae if someone can lead me to the right direction.
def update_status
@books=Book.find(:all)
for book in @books
Record.update_attributes
(:status=>‘read’,:conditions[‘records.name=?’,books.name])
end