I have this controller (simplified for the sake of clarity)
module BackOffice
class MaintenancePeriodsController < BackOfficeController
decorates_assigned :housing_unit
def create
end
def destroy
end
def edit
end
def update
end
end
end
with these routes
# routes.rb
resources :housing_units do
resources :maintenance_periods, only: %i[create destroy edit update]
end
back_office_housing_unit_maintenance_periods POST /back_office/housing_units/:housing_unit_id/maintenance_periods(.:format) back_office/maintenance_periods#create
edit_back_office_housing_unit_maintenance_period GET /back_office/housing_units/:housing_unit_id/maintenance_periods/:id/edit(.:format) back_office/maintenance_periods#edit
back_office_housing_unit_maintenance_period PATCH /back_office/housing_units/:housing_unit_id/maintenance_periods/:id(.:format) back_office/maintenance_periods#update
PUT /back_office/housing_units/:housing_unit_id/maintenance_periods/:id(.:format) back_office/maintenance_periods#update
DELETE /back_office/housing_units/:housing_unit_id/maintenance_periods/:id(.:format) back_office/maintenance_periods#destroy
When I run rake routes I get this even though I clearly don't have any controller action called housing_unit
I have this controller (simplified for the sake of clarity)
with these routes
When I run rake routes I get this even though I clearly don't have any controller action called
housing_unit
My guess is that Draper adds a method under the hood to decorate an object in our codebase called HousingUnit. They showed a basic example of that in their README.md
Could you confirm that and if so tell us how we can go around this issue ?
Thanks in advance for all your help and this very cool gem 🙏