|
|
@ -33,9 +33,17 @@ class CaseLogsController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
# We don't have a dedicated non-editable show view |
|
|
|
|
|
|
|
def show |
|
|
|
def show |
|
|
|
edit |
|
|
|
respond_to do |format| |
|
|
|
|
|
|
|
format.html { edit } |
|
|
|
|
|
|
|
format.json do |
|
|
|
|
|
|
|
if (case_log = CaseLog.find_by(id: params[:id])) |
|
|
|
|
|
|
|
render json: case_log, status: :ok |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
render json: { error: "Case Log #{params[:id]} not found" }, status: :not_found |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def edit |
|
|
|
def edit |
|
|
@ -90,7 +98,7 @@ class CaseLogsController < ApplicationController |
|
|
|
|
|
|
|
|
|
|
|
private |
|
|
|
private |
|
|
|
|
|
|
|
|
|
|
|
API_ACTIONS = %w[create update destroy].freeze |
|
|
|
API_ACTIONS = %w[create show update destroy].freeze |
|
|
|
|
|
|
|
|
|
|
|
def question_responses(questions_for_page) |
|
|
|
def question_responses(questions_for_page) |
|
|
|
questions_for_page.each_with_object({}) do |(question_key, question_info), result| |
|
|
|
questions_for_page.each_with_object({}) do |(question_key, question_info), result| |
|
|
|