fixes #30 - edit from summary with out js
This commit is contained in:
@ -26,14 +26,14 @@ class CandidateController < ApplicationController
|
||||
end
|
||||
|
||||
def question
|
||||
qid = prep_status.current_question_id
|
||||
qid = prep_status.current_question_id || params[:question_id]
|
||||
redirect_to :summary and return if qid.nil?
|
||||
prep_question qid
|
||||
prep_instance_answer @question
|
||||
end
|
||||
|
||||
def update_answer
|
||||
qid = params[:qid] ||= prep_status.current_question_id
|
||||
qid = answer_params[:question_id] || prep_status.current_question_id
|
||||
@answer = prep_answer qid
|
||||
send "process_#{prep_question(qid).input_type}"
|
||||
end
|
||||
@ -114,7 +114,7 @@ class CandidateController < ApplicationController
|
||||
render :question
|
||||
else
|
||||
# TODO: change params.key? to submit = save/next/summary
|
||||
redirect_to :summary and return if params.key?(:update)
|
||||
# redirect_to :summary and return if params.key?(:update)
|
||||
redirect_to :saved and return if params.key?(:save)
|
||||
redirect_to :question
|
||||
end
|
||||
|
@ -22,7 +22,7 @@
|
||||
<% if @status.on_summary %>
|
||||
|
||||
<div class="btn-container-summary">
|
||||
<input type="submit" name="update" value="Save and return to summary">
|
||||
<input type="submit" name="submit" value="Save and return to summary">
|
||||
</div>
|
||||
|
||||
<% else %>
|
||||
|
@ -6,7 +6,7 @@
|
||||
</p>
|
||||
|
||||
<% @quiz.each do |question| %>
|
||||
<%= form_for(:answer, url: post_answer_path(answer_id: question.answer_id, qid: question.question_id), html:{class: 'summary-form'}) do |form| %>
|
||||
<%= form_for(:answer, url: post_answer_path(answer_id: question.answer_id), html:{class: 'summary-form'}) do |form| %>
|
||||
<article class="answer-sec <%= question.input_type %>-type" data-qid="<%= question.question_id %>">
|
||||
<div class="question-heading">
|
||||
<div class="question-title">
|
||||
|
Reference in New Issue
Block a user