必答按钮的数据存入

This commit is contained in:
sw 2015-01-15 16:50:06 +08:00
parent f78de71814
commit 870f9bba98
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class PollController < ApplicationController
def create_poll_question def create_poll_question
question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title] question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title]
option = { option = {
:is_necessary => params[:is_necessary] || 1, :is_necessary => (params[:is_necessary]=="true" ? 1 : 0),
:question_title => question_title, :question_title => question_title,
:question_type => params[:question_type] || 1, :question_type => params[:question_type] || 1,
:question_number => @poll.poll_questions.count + 1 :question_number => @poll.poll_questions.count + 1

View File

@ -6,7 +6,7 @@
<label>问题:&nbsp;&nbsp;</label> <label>问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/> <input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<input class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" placeholder="请输入单选题标题" value="<%= poll_question.question_title%>"/> <input class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" placeholder="请输入单选题标题" value="<%= poll_question.question_title%>"/>
<input type="checkbox" name="is_necessary" value="true" checked = "<%= poll_question.is_necessary == 1%>"/> <input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
<label>必答</label> <label>必答</label>
</div> </div>
<div class="ur_editor_content"> <div class="ur_editor_content">