2011-11-15 24 views
0

所以,我使用activescaffold並有下面的代碼:活動腳手架:如何在刪除操作上設置確認文本?

config.actions = [:create, :delete, :list] 
config.delete.link.confirm "Are you sure you want to delete this tag?" 

它根據我GOOGLE了應該做的刪除鏈接確認框顯示的自定義文本......但事實並非如此。它仍然使用一些默認的問題文本。我如何定製確認文本?

+0

你做的link_to或button_to?以及什麼版本的rails,js lib等?你如何將這些方法鏈接在一起? – edwardsharp

+0

活動腳手架生成鏈接 –

+1

您的意思是Gem [ActiveScaffold](https://github.com/activescaffold/active_scaffold)?它只被作爲標籤提及... – mliebelt

回答

1

它應該工作!

我已經開始了一個git代表與activescaffold相關的修復程序共享代碼。

你可以看到我的控制器在這裏: https://github.com/whizcreed/activescaffold-answers-to-stackoverflow/blob/master/app/controllers/notes_controller.rb

這裏是正常工作的代碼:我使用的軌道2.3.10 和activescaffold分支

class NotesController < ApplicationController 
    active_scaffold :notes do |config| 
    config.columns = [:title, :content] 
    config.delete.link.confirm = "Shows that you can change the confirm text for delete!" 
    end 
end 

https://github.com/activescaffold/active_scaffold/tree/rails-2.3

我希望這有幫助。

1

你缺少的= 應該是:

config.delete.link.confirm = "Are you sure you want to delete this tag?" 
相關問題