Scoped all controllers inside body_trackers
Fixed main menu item highlighting
This commit is contained in:
parent
158685459d
commit
628578cda5
@ -1,4 +1,6 @@
|
||||
class BodyTrackersController < ApplicationController
|
||||
menu_item :body_trackers
|
||||
|
||||
before_action :find_project_by_project_id, only: [:index, :defaults]
|
||||
before_action :authorize
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
class IngredientsController < ApplicationController
|
||||
require 'csv'
|
||||
|
||||
menu_item :body_trackers
|
||||
|
||||
before_action :init_session_filters
|
||||
before_action :find_project_by_project_id,
|
||||
only: [:index, :nutrients, :create, :import, :filter, :filter_nutrients]
|
||||
|
@ -1,4 +1,6 @@
|
||||
class MeasurementsController < ApplicationController
|
||||
menu_item :body_trackers
|
||||
|
||||
before_action :find_project_by_project_id, only: [:index, :create]
|
||||
before_action :find_measurement, only: [:destroy, :toggle]
|
||||
before_action :authorize
|
||||
|
@ -1,4 +1,6 @@
|
||||
class QuantitiesController < ApplicationController
|
||||
menu_item :body_trackers
|
||||
|
||||
before_action :init_session_filters
|
||||
before_action :find_project_by_project_id, only: [:index, :parents, :create, :filter]
|
||||
before_action :find_quantity, only: [:edit, :update, :destroy, :toggle, :move]
|
||||
|
@ -1,4 +1,6 @@
|
||||
class SourcesController < ApplicationController
|
||||
menu_item :body_trackers
|
||||
|
||||
before_action :find_project_by_project_id, only: [:index, :create]
|
||||
before_action :find_source, only: [:destroy]
|
||||
before_action :authorize
|
||||
|
@ -1,4 +1,6 @@
|
||||
class UnitsController < ApplicationController
|
||||
menu_item :body_trackers
|
||||
|
||||
before_action :find_project_by_project_id, only: [:index, :create]
|
||||
before_action :find_unit, only: [:destroy]
|
||||
before_action :authorize
|
||||
|
@ -1,11 +1,10 @@
|
||||
# Plugin's routes
|
||||
# See: http://guides.rubyonrails.org/routing.html
|
||||
|
||||
resources :projects do
|
||||
shallow do
|
||||
resources :projects, shallow: true do
|
||||
resources :body_trackers, only: [:index] do
|
||||
post 'defaults', on: :collection
|
||||
end
|
||||
collection do
|
||||
post 'defaults'
|
||||
resources :measurements, only: [:index, :create, :destroy] do
|
||||
post 'toggle', on: :member
|
||||
end
|
||||
@ -33,3 +32,4 @@ resources :projects do
|
||||
resources :units, only: [:index, :create, :destroy]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user