summaryrefslogtreecommitdiff
path: root/app/controllers/events_controller.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-26 01:59:57 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-26 01:59:57 +0200
commitc06723ee715512c2033c7786c48f15674585b56b (patch)
tree46d074bde9a4fc61f0a76cbc601007ed4412ec61 /app/controllers/events_controller.rb
parent0818a3057b0a91e422158d828026c941b4e10622 (diff)
Stage 4: Rails 5.2 -> 6.1 on Ruby 2.7.2
- routing-filter 0.6.3 -> 0.7.0 (Rails 6.1 compatibility) - RSS named routes rss_xml/rss_rdf added - RouteWithParams workarounds: will_paginate_patch, content_path shim, safe_path helper - Paperclip removed, replaced with FileAttachment concern (preserves URL scheme) - Assets resource moved to /admin/assets (Sprockets middleware conflict) - ApplicationRecord base class added, all models migrated - Strong parameters added to Assets, Occurrences, Events, MenuItems controllers - update_attributes -> update throughout - render :nothing -> head :ok/:not_found throughout - language_selector rewritten (removes :overwrite_params) - Environment files updated for Rails 6.1 (eager_load, public_file_server, ActionMailer) - Arel::Visitors::DepthFirst and Integer/Float duration patches removed from test_helper - AssetsController tests added (10 tests covering upload, variants, destroy, auth) - ImageMagick geometry: 460x250! for headline crop (not # which is invalid in IM6) 129 runs, 311 assertions, 5 failures (all pre-existing), 0 errors
Diffstat (limited to 'app/controllers/events_controller.rb')
-rw-r--r--app/controllers/events_controller.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb
index 6eba476..7695e9b 100644
--- a/app/controllers/events_controller.rb
+++ b/app/controllers/events_controller.rb
@@ -47,7 +47,7 @@ class EventsController < ApplicationController
47 # POST /events 47 # POST /events
48 # POST /events.xml 48 # POST /events.xml
49 def create 49 def create
50 @event = Event.new(params[:event]) 50 @event = Event.new(event_params)
51 51
52 respond_to do |format| 52 respond_to do |format|
53 if @event.save 53 if @event.save
@@ -67,7 +67,7 @@ class EventsController < ApplicationController
67 @event = Event.find(params[:id]) 67 @event = Event.find(params[:id])
68 68
69 respond_to do |format| 69 respond_to do |format|
70 if @event.update_attributes(params[:event]) 70 if @event.update(event_params)
71 flash[:notice] = 'Event was successfully updated.' 71 flash[:notice] = 'Event was successfully updated.'
72 format.html { redirect_to(edit_node_path(@event.node)) } 72 format.html { redirect_to(edit_node_path(@event.node)) }
73 format.xml { head :ok } 73 format.xml { head :ok }
@@ -89,4 +89,10 @@ class EventsController < ApplicationController
89 format.xml { head :ok } 89 format.xml { head :ok }
90 end 90 end
91 end 91 end
92
93 private
94
95 def event_params
96 params.require(:event).permit(:start_time, :end_time, :rrule, :custom_rrule, :allday, :url, :latitude, :longitude, :node_id, :location)
97 end
92end 98end