From 158ea7dc413b388fb542aa2f2b5e931f4e1490ac Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 17 Dec 2016 15:36:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=8A=A5=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index b88ecf775..ec224515b 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -299,7 +299,8 @@ class PollController < ApplicationController def commit_answer pq = PollQuestion.find(params[:poll_question_id]) if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?) - render :json => {:text => "failure"} + @percent = get_percent(@poll,User.current) + render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)} return end if pq.question_type == 1