mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-12 18:21:38 -05:00
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. |
||
|---|---|---|
| .. | ||
| _countries.html.erb | ||
| _distance.html.erb | ||
| _form.html.erb | ||
| _path.html.erb | ||
| _sharing.html.erb | ||
| _trip.html.erb | ||
| edit.html.erb | ||
| index.html.erb | ||
| new.html.erb | ||
| public_show.html.erb | ||
| show.html.erb | ||