私はこのページ(http://lesseverything.com/blog/archives/2012/07/18/customizing-confirmation-dialog-in-rails/)を見ていましたが、そこにいくつかのコードを示していますが、私のアプリにどのように実装できるのか分かりません。ブートストラップのモーダルで「削除確認ダイアログ」を表示するにはどうしたらいいですか?ブラウザのデフォルトと似ていません
私はRails3.2、Bootstrap.cssとJQueryを使用します。
ブートストラップのモーダルで「削除確認ダイアログ」を表示するために正確に何をしなければならないか教えてもらえますか?
UPDATE:
資産/ JavaScriptの/
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery-ui
//= require twitter/bootstrap
//= require_tree .
//= require jquery.ui.datepicker
//= require autocomplete-rails
詳細な説明をありがとうございます。最初のコードを 'communities.js.coffee'にコピーし、2番目のコードを'/views/communities/index.html.erb'にコピーしました。しかし、モーダルはポップアップしません。依然としてデフォルトのダイアログがポップアップします。なぜなのかご存知ですか? – cat
チェックするには:ブートストラップJavaScriptをRailsに追加したとします(CSSだけではない) - 'bootstrap.min.js'または' bootstrap.js'もあなたのアセットパスにあるはずですか?ページを読み込んだり、[削除]をクリックしたときにJavaScriptコンソールに表示されるエラーにはどのようなものがありますか? – mccannf
ありがとうございます。 ** assets/javascript **には 'bootstrap.js.coffee'、' rails.js'、** assets/stylesheets **には 'bootstrap.css.erb'があります。私は自分の質問を更新しました。 – cat