We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
plans/_show.json.jbuilder
1 parent ce720b6 commit f8c7d42Copy full SHA for f8c7d42
1 file changed
app/views/api/v2/plans/_show.json.jbuilder
@@ -4,7 +4,7 @@
4
5
json.schema 'https://github.com/RDA-DMP-Common/RDA-DMP-Common-Standard/tree/master/examples/JSON/JSON-schema/1.0'
6
7
-presenter = Api::V2::PlanPresenter.new(plan: plan)
+presenter = Api::V2::PlanPresenter.new(plan: plan, complete: @complete)
8
9
# Note the symbol of the dmproadmap json object
10
# nested in extensions which is the container for the json template object, etc.
@@ -68,5 +68,19 @@ unless @minimal
68
json.title template.title
69
end
70
71
+
72
+ if @complete
73
+ json.complete_plan do
74
+ q_and_a = presenter.complete_plan_data
75
+ next if q_and_a.blank?
76
77
+ json.array! q_and_a do |item|
78
+ json.title item[:title]
79
+ json.section item[:section]
80
+ json.question item[:question]
81
+ json.answer item[:answer]
82
+ end
83
84
85
86
0 commit comments