2012-03-13 48 views
0

我在命名空間環境中具有以下內容。Rails 3刪除確認無法顯示

這是在我的文章索引文件中刪除一篇文章。

<%=button_to "Delete", admin_article_path(article), :class => 'button', :confirm => "Are you sure?", :method => :delete%> 

但是,它刪除記錄,但確認沒有出現。

任何想法,爲什麼?還是我有這個錯誤?

由於提前

+0

呈現的HTML看起來像什麼? – Chowlett 2012-03-13 16:57:54

+0

Clay 2012-03-13 18:24:54

+0

嘗試'<%= button_to「刪除」,admin_article_path(article),{:class =>'button' ,:confirm =>「Are you sure?」,:method =>:delete}%>'。如果有效,我會將其作爲答案發布。 – Chowlett 2012-03-13 20:26:53

回答

0

確保您的JavaScript包括包括rails.js(通常,這意味着確保rails.js在app/assets/javascripts,因爲<%= javascript_include_tag "application" %>可能會包括整個樹)。

此外,請確保您的佈局的<head>標籤包含<%= csrf_meta_tag %>