From d2fadfda085f17d35cad7c7787f52cf5e49060b6 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 Jan 2015 10:11:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E9=80=89=E9=A2=98=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=AD=94=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 8 ++++---- app/views/poll/show.html.erb | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index fcc1eef61..f83ff7cb9 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -113,11 +113,11 @@ class PollController < ApplicationController #提交答案 def commit_answer @pv = get_poll_vote(User.current.id,params[:poll_question_id]) - if params[:poll_vote][:poll_answer_id] - @pv.poll_answer_id = params[:poll_vote][:poll_answer_id] + if params[:poll_answer_id] + @pv.poll_answer_id = params[:poll_answer_id] end - if params[:poll_vote][:vote_text] - @pv.vote_text = params[:poll_vote][:vote_text] + if params[:vote_text] + @pv.vote_text = params[:vote_text] end @pv_saved = false if @pv.save diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 08dae18b2..86815f80a 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -42,21 +42,22 @@