diff --git a/app/views/branded/plans/plan_details/_linked_fragment_list.html.erb b/app/views/branded/plans/plan_details/_linked_fragment_list.html.erb index 8678eb0..ff41762 100644 --- a/app/views/branded/plans/plan_details/_linked_fragment_list.html.erb +++ b/app/views/branded/plans/plan_details/_linked_fragment_list.html.erb @@ -24,7 +24,7 @@ + data-url="<%= structured_answer_path(obj.id, plan_id: plan.id) %>"><%= _('Delete') %> <% end %> diff --git a/app/views/branded/plans/plan_details/_linked_fragment_modal.html.erb b/app/views/branded/plans/plan_details/_linked_fragment_modal.html.erb index 647f4e4..38363d0 100644 --- a/app/views/branded/plans/plan_details/_linked_fragment_modal.html.erb +++ b/app/views/branded/plans/plan_details/_linked_fragment_modal.html.erb @@ -6,7 +6,7 @@ - <%= form_for @fragment, url: create_or_update_plan_structured_answers_path(plan_id: @plan.id, type: @type, fragment_id: @fragment.id), + <%= form_for @fragment, url: create_or_update_structured_answers_path(@fragment.id, type: @type, plan_id: @plan.id), html: {method: :post, remote: true, class: 'form-horizontal edit_plan', id: "structured_answer_form" } do |f| %> <%= f.hidden_field :dmp_id, :value => @parent_fragment.dmp.id , id: nil %> <%= f.hidden_field :parent_id, :value => @parent_fragment.id , id: nil %> diff --git a/app/views/branded/shared/fragments/_person_fragment_form.html.erb b/app/views/branded/shared/fragments/_person_fragment_form.html.erb index c550d2e..92ebf15 100644 --- a/app/views/branded/shared/fragments/_person_fragment_form.html.erb +++ b/app/views/branded/shared/fragments/_person_fragment_form.html.erb @@ -2,7 +2,7 @@
<%= legend %> -
+
<%= f.label "#{fragment_name}_person_list", _('Please choose a person from the list or create a new one.'), class: 'control-label' %>
@@ -11,7 +11,7 @@ options_for_select( person_list.map { |p| [ p.to_s, p.id, - { "data-url" => get_fragment_plan_structured_answers_path(plan.id, p.id) } + { "data-url" => get_fragment_structured_answers_path(p.id, plan_id: plan.id) } ] }, selected: person_id), class: "form-control generic-fragment-picker", diff --git a/config/routes.rb b/config/routes.rb index 65dbca4..632b2f3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -119,13 +119,14 @@ post 'set_test', constraints: {format: [:json]} get 'overview' end - resources :structured_answers, only: [:destroy] do - post 'create_or_update', on: :collection - get 'get_fragment/:id', action: :get_fragment, on: :collection, as: :get_fragment - end resources :research_outputs, only: [:index, :destroy], controller: 'research_outputs' end + resources :structured_answers, only: [:destroy] do + post 'create_or_update', on: :collection + get 'get_fragment/:id', action: :get_fragment, on: :collection, as: :get_fragment + end + resources :usage, only: [:index] resources :usage_downloads, only: [:index]