diff --git a/app/controllers/answers_controller.rb b/app/controllers/answers_controller.rb index b590d41..c60fbd3 100644 --- a/app/controllers/answers_controller.rb +++ b/app/controllers/answers_controller.rb @@ -23,6 +23,7 @@ if @answer.nil? @answer = Answer.new(params[:answer]) + @answer.text = params["answer-text-#{@answer.question_id}".to_sym] authorize @answer @answer.save else diff --git a/app/views/answers/update.js.erb b/app/views/answers/update.js.erb index 1ffdc73..781c176 100644 --- a/app/views/answers/update.js.erb +++ b/app/views/answers/update.js.erb @@ -19,4 +19,4 @@ // so that the next save can work. If you don't do // this it will fail forever. -$("#answer_lock_version").val(<%= @lock_version %>); +$("#answer_lock_version-<%=@question.id%>").val(<%= @lock_version %>); diff --git a/app/views/phases/_answer_form.html.erb b/app/views/phases/_answer_form.html.erb index 763735b..90880c5 100644 --- a/app/views/phases/_answer_form.html.erb +++ b/app/views/phases/_answer_form.html.erb @@ -19,12 +19,12 @@ %>