我在我的軌道應用程序與twitter引導中使用AJAX crud操作。當我點擊提交帖子,然後顯示成功的Flash消息,但隨着關閉按鈕不顯示。警告關閉按鈕不顯示在軌道上的紅寶石jquery .html()
這裏是我的代碼...
<div id="flash_notice" class="alert span6"></div>
這裏是我的形式...
<%= form_for(@post, :remote => true, :html => {:id => "prayer_form"}) do |f| %>
<div id= "post_errors" style="display:none"></div>
<p>
<%= f.select :title, options_for_select(["Relationship", "Family", "Health", "Personal", "Professional", "Education", "Tours & Travel", "Exams", "Job", "Society", "Career", "Marriage", "Relationship", "Friendship", "Event", "Success/Failure", "others"]), {:include_blank => "Select Prayer Category"}, {:multiple => false,:class => "required"} %>
</p>
<p>
<%= f.text_area :content, :rows => 5, :class=>"span12 required", :placeholder => "Create your prayer" %>
</p>
<p><%= f.submit "Add Prayer", :class=>"btn btn-primary"%></p>
<% end %>
這裏是我的create.js.erb
$("#post_errors").hide(300);
$("#flash_notice").html("<%= escape_javascript(flash[:notice] <button type='button' class='close' data-dismiss='alert'>×</button>) %>");
$("#flash_notice").show(300);
$(":input:not(input[type=submit])").val("");
$("#posts_list").html("<%= escape_javascript(render(:partial => "posts")) %>");
的application.js
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
閃光警報顯示,但爲什麼我的關閉圖標按鈕沒有顯示。請幫助
什麼是您的application.js是什麼樣子?你可以請發佈你的代碼示例 – Uchenna 2013-05-06 10:30:22