活动脚手架:如何设置删除操作的确认文本?
因此,我正在使用 activescaffold 并具有以下代码:
config.actions = [:create, :delete, :list]
config.delete.link.confirm "Are you sure you want to delete this tag?"
根据我在谷歌上搜索的内容,应该使删除链接确认框显示该自定义文本...但事实并非如此。它仍然使用一些默认的问题文本。如何自定义确认文本?
So, I'm using activescaffold and have the following code:
config.actions = [:create, :delete, :list]
config.delete.link.confirm "Are you sure you want to delete this tag?"
which according to what I've googled should make the delete link confirmation box display that custom text... but it doesn't. It still uses some default question text. How can I customize the confirmation text?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它应该有效!
我已经启动了 git 代表来共享与 activescafold 相关的修复代码。
您可以在这里看到我的控制器:
https://github.com/whizcreed /activescaffold-answers-to-stackoverflow/blob/master/app/controllers/notes_controller.rb
这是正确工作的代码:
我是使用导轨 2.3.10
和 activescaffold 分支: https://github.com/activescaffold/active_scaffold/tree/rails-2.3
我希望这有帮助。
It should work!
I have started a git rep to share code with fixes related to activescaffold.
You can see my controller here:
https://github.com/whizcreed/activescaffold-answers-to-stackoverflow/blob/master/app/controllers/notes_controller.rb
And here is the code that works correctly:
I am using rails 2.3.10
and activescaffold branch: https://github.com/activescaffold/active_scaffold/tree/rails-2.3
I hope this helps.
您缺少
=
应该是:
you are missing the
=
it should be:
为什么不使用视图层来解决这个问题呢?
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html
Why not approach this problem using the view layer?
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html