dawarich/app/controllers/shared
Claude 9fba3ce4ca
Refactor: Move trip sharing management to trips#update
Simplifies architecture by using the existing trips#update route for
sharing settings management instead of a separate route.

## Changes

**Routes**
- Removed: PATCH /trips/:id/sharing → shared/trips#update
- Now uses: PATCH /trips/:id (existing route) with sharing params

**Controllers**
- Shared::TripsController: Simplified to only handle public view (show)
- TripsController: Added update_sharing private method to handle
  sharing params when present

**Views**
- Updated JavaScript in _sharing.html.erb to use trip_path with
  nested sharing params

**Tests**
- Updated request specs to use trip_path instead of sharing_trip_path
- All params now nested under sharing key

## Benefits
- Cleaner namespace separation (Shared:: only for public access)
- Follows Rails conventions (one update route handles everything)
- Simpler routing structure
- Reduced code duplication

## Backwards Compatibility
This is a breaking change for the sharing API endpoint, but since
this feature was just implemented and hasn't been released yet,
no migration path is needed.
2025-11-05 15:54:42 +00:00
..
stats_controller.rb Remove permanent option from stats sharing options, default to 24h expiration. 2025-09-19 23:49:32 +02:00
trips_controller.rb Refactor: Move trip sharing management to trips#update 2025-11-05 15:54:42 +00:00