1
0

Fix target subtreshold listing

Route targets under goal
This commit is contained in:
cryptogopher
2021-03-06 13:00:50 +01:00
parent 09e27eb754
commit 406eabaccc
9 changed files with 27 additions and 15 deletions

View File

@@ -104,7 +104,7 @@ en:
link_new_goal: 'New goal'
targets:
contextual:
link_new_target: 'New target'
link_new_target: 'New target(s)'
form:
choose_quantity: 'Choose quantity'
button_new_target: 'Add target'

View File

@@ -9,14 +9,18 @@ resources :projects, shallow: true do
end
resources :goals do
member do
get 'targets', controller: :targets, action: :index, as: :targets
#get 'targets', controller: :targets, action: :index, as: :targets
post 'toggle_exposure', controller: :targets
end
resources :targets, only: [:index] do
collection do
get 'subthresholds/(:parent_id)', action: :subthresholds, as: :subthresholds
end
end
end
resources :targets, except: [:show, :edit] do
collection do
get 'edit/:date', action: :edit, as: :edit
get 'subthresholds/(:parent_id)', action: :subthresholds, as: :subthresholds
post 'reapply/:date', action: :reapply, as: :reapply
end
end