diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
| commit | 9a19a0494ef51cdac9a78e24d517ca48ba44c453 (patch) | |
| tree | 8eaae12d8047a40e29d3ea7ff3116b5c869e04bd /app/controllers/occurrences_controller.rb | |
| parent | 85a01e35274b8d4d4165a7b26bd7986e211246bb (diff) | |
| parent | 1853082fcd8c067390c246f9daa01a9b47387497 (diff) | |
Migration from Rails 2.3.5 to Rails 8.1 successful.
Merging dev branch.
Diffstat (limited to 'app/controllers/occurrences_controller.rb')
| -rw-r--r-- | app/controllers/occurrences_controller.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/controllers/occurrences_controller.rb b/app/controllers/occurrences_controller.rb index 751be40..0f30ce3 100644 --- a/app/controllers/occurrences_controller.rb +++ b/app/controllers/occurrences_controller.rb | |||
| @@ -2,7 +2,7 @@ class OccurrencesController < ApplicationController | |||
| 2 | 2 | ||
| 3 | # Private | 3 | # Private |
| 4 | 4 | ||
| 5 | before_filter :login_required | 5 | before_action :login_required |
| 6 | 6 | ||
| 7 | # GET /occurrences | 7 | # GET /occurrences |
| 8 | # GET /occurrences.xml | 8 | # GET /occurrences.xml |
| @@ -45,7 +45,7 @@ class OccurrencesController < ApplicationController | |||
| 45 | # POST /occurrences | 45 | # POST /occurrences |
| 46 | # POST /occurrences.xml | 46 | # POST /occurrences.xml |
| 47 | def create | 47 | def create |
| 48 | @occurrence = Occurrence.new(params[:occurrence]) | 48 | @occurrence = Occurrence.new(occurrence_params) |
| 49 | 49 | ||
| 50 | respond_to do |format| | 50 | respond_to do |format| |
| 51 | if @occurrence.save | 51 | if @occurrence.save |
| @@ -65,7 +65,7 @@ class OccurrencesController < ApplicationController | |||
| 65 | @occurrence = Occurrence.find(params[:id]) | 65 | @occurrence = Occurrence.find(params[:id]) |
| 66 | 66 | ||
| 67 | respond_to do |format| | 67 | respond_to do |format| |
| 68 | if @occurrence.update_attributes(params[:occurrence]) | 68 | if @occurrence.update(occurrence_params) |
| 69 | flash[:notice] = 'Occurrence was successfully updated.' | 69 | flash[:notice] = 'Occurrence was successfully updated.' |
| 70 | format.html { redirect_to(@occurrence) } | 70 | format.html { redirect_to(@occurrence) } |
| 71 | format.xml { head :ok } | 71 | format.xml { head :ok } |
| @@ -87,4 +87,11 @@ class OccurrencesController < ApplicationController | |||
| 87 | format.xml { head :ok } | 87 | format.xml { head :ok } |
| 88 | end | 88 | end |
| 89 | end | 89 | end |
| 90 | |||
| 91 | private | ||
| 92 | |||
| 93 | def occurrence_params | ||
| 94 | params.require(:occurrence).permit(:start_time, :end_time, :node_id, :event_id) | ||
| 95 | end | ||
| 96 | |||
| 90 | end | 97 | end |
