增加修改单选题的路由、action、以及js
This commit is contained in:
parent
5ec2789881
commit
d55492b07a
|
@ -114,7 +114,12 @@ class PollController < ApplicationController
|
|||
|
||||
#修改单选题
|
||||
def update_poll_question
|
||||
a = 1
|
||||
@poll_question = PollQuestion.find params[:poll_question]
|
||||
@poll = @poll_question.poll
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#删除单选题
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<%= form_for poll_question,:url =>update_poll_question_poll_path(@poll.id),:remote => true do |f|%>
|
||||
<div>
|
||||
<%= form_for(poll_question,:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
|
||||
<!--编辑单选start-->
|
||||
<div class="ur_editor radio">
|
||||
<div class="ur_editor_title">
|
||||
|
@ -23,11 +22,10 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().parent().submit();">确定</a>
|
||||
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
|
||||
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="pollQuestionCancel(<%= poll_question.id%>);">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--编辑单选 end-->
|
||||
</div>
|
||||
<% end%>
|
|
@ -62,10 +62,10 @@ RedmineApp::Application.routes.draw do
|
|||
member do
|
||||
get 'statistics_result'
|
||||
post 'create_poll_question'
|
||||
post 'update_poll_question'
|
||||
end
|
||||
collection do
|
||||
delete 'delete_poll_question'
|
||||
post 'update_poll_question'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue