completes #17 - live-coder plus text input type

Squashed commit of the following:

commit d41cbf66eb2a9ee705ab60bb156eed95881fa193
Author: Mark Moser <mark.moser@perficient.com>
Date:   Thu Aug 4 19:58:20 2016 -0500

    live-coder-text validations

commit 866bfeb863516a8656bc26b10f967d0b9b8d8505
Author: Mark Moser <mark.moser@perficient.com>
Date:   Thu Aug 4 11:57:57 2016 -0500

    getting things green again and rebasing develop

commit 28a23200f291e30c690b71e9bcae3e1a69eb3093
Author: Derek Montgomery <montgomerygraphics@gmail.com>
Date:   Thu Aug 4 10:14:23 2016 -0500

    Progress on live coder text field
This commit is contained in:
Mark Moser
2016-08-04 20:01:17 -05:00
parent 635297884d
commit fc784ffcb1
11 changed files with 136 additions and 23 deletions

View File

@@ -42,7 +42,7 @@ class CandidateController < ApplicationController
prep_question params[:question_id]
prep_instance_answer @question
prep_answer params[:question_id]
render layout: false
render @question.input_type, layout: false
end
def summary
@@ -95,8 +95,13 @@ class CandidateController < ApplicationController
def answer_params
params.require(:answer).permit(
:question_id, :answer_id,
:radio, :text, checkbox: [], live_code: [:later, :html, :css, :js]
:question_id,
:answer_id,
:radio,
:text,
checkbox: [],
live_code: [:later, :html, :css, :js],
live_code_text: [:later, :html, :css, :js, :text]
)
end
@@ -148,4 +153,11 @@ class CandidateController < ApplicationController
submitted: params.key?(:submit))
route_answer
end
def process_live_code_text
@answer.update(answer: answer_params[:live_code_text].to_h,
saved: params.key?(:save),
submitted: params.key?(:submit))
route_answer
end
end