在这个反射中,我希望将lastupdateby字段设置为current_user。我还没能让它工作。是否需要做些什么才能在反射中获得该值?对我做错了什么有什么想法吗?如果我硬编码值而不是current_user,它就能工作。我一定是引用错了。
def toggle
todo = Todo.find(element.dataset[:id])
todo.update(completed_at: (todo.completed_at? ? nil : Time.current), lastUpdatedBy: current_user)
end发布于 2020-10-12 17:29:26
https://stackoverflow.com/questions/64279653
复制相似问题