From d55492b07a183410dbbc05f2d1e264e7fd047f22 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 15 Jan 2015 18:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=8D=95?= =?UTF-8?q?=E9=80=89=E9=A2=98=E7=9A=84=E8=B7=AF=E7=94=B1=E3=80=81action?= =?UTF-8?q?=E3=80=81=E4=BB=A5=E5=8F=8Ajs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 7 ++- app/views/poll/_edit_MC.html.erb | 58 +++++++++++----------- app/views/poll/update_poll_question.js.erb | 0 config/routes.rb | 2 +- 4 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 app/views/poll/update_poll_question.js.erb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 48b1af43a..e94b0f132 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -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 #删除单选题 diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb index 6010132fb..fa0e8d802 100644 --- a/app/views/poll/_edit_MC.html.erb +++ b/app/views/poll/_edit_MC.html.erb @@ -1,33 +1,31 @@ -<%= form_for poll_question,:url =>update_poll_question_poll_path(@poll.id),:remote => true do |f|%> -