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 @@