Rails:JavaScript 关闭时不显眼的删除
如果 JavaScript 关闭,不显眼的删除如何工作?
鉴于 data-method='delete' 被忽略,您似乎只是获得了记录的链接。我想这就是意图,对于开发人员来说这当然是快速和简单的,但如果是这样的话,它并没有真正符合用户单击“删除”链接时所期望的效果。
How does unobtrusive delete work if JavaScript is turned off?
It seems like you just get a link to the record, given that data-method='delete' is ignored. I guess that's the intention, it's certainly quick and easy for the developer, but if that's the case, it doesn't really stack up with what the user would expect if they click a "delete" link.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确实有一篇优秀的博客文章涵盖了这一点。
There is really an excellent blog post covering just this.
尝试将
?_method=delete
添加到删除链接。完全未经测试的代码:Try adding
?_method=delete
to your delete links. Completely untested code: