所以我有一个名为“首选项”的表格列。这只是布尔值的序列化散列,因为唯一的偏好是用户是否想要某些操作的电子邮件通知。
所以就像
{
users: { role_granted: true },
owners_and_co: { new_comment: true,
commited: true,
published: true,
submitted: true },
co: { submitted: true,
deactivated: true,
deleted: true,
new_co_owner: true },
requirement_editors: { commited: true,
deactived: true,
deleted: true },
resource_editors: { commited: true,
deactived: true,
deleted: true,
associated_commited: true },
institutional_reviewers: { submitted: true,
new_comment: true,
approved_rejected: true }
}
我只想将其作为表单上的复选框列表,但我不确定最干净的方法。任何帮助,将不胜感激。