实现新增单选题题时页面的刷新

This commit is contained in:
sw 2015-01-15 16:31:40 +08:00
parent a1f21f3ebb
commit 5792bd77e5
2 changed files with 12 additions and 2 deletions

View File

@ -96,9 +96,10 @@
</div>
</div>
<% end %>
<div id="new_poll_question">
</div>
<!-- 新增问题 -->
<div id="new_poll_question">
</div>
<div class="ur_buttons">

View File

@ -1 +1,10 @@
$("#new_poll_question").html("");
$("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");