Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么 Ruby on Rails 不够聪明,无法猜测隐藏字段中的渲染外键?我怎样才能避免像这样手动渲染隐藏字段?
这是因为在表单的隐藏字段中保留外键不是很聪明。因为然后用户可以更改该外键,例如向他被阻止的帖子发送评论。最好从 url 参数或以任何其他方式在服务器端获取该外键。