t = Todo.find_by_id(params[:id]) t.state = true t.save