aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-12-17 16:32:09 +0000
committerMatthew Lemon <y@yulqen.org>2023-12-17 16:32:09 +0000
commit86916794341f20b26b9a321f1e15f9521f94a618 (patch)
tree71c9dbdcabb4312d502f2411ea0e90ae1042fe5c /app/controllers
parentc84b94a647fb4c068e8be9d0495ff7284f41f168 (diff)
Tidied up the basic event index and form
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/events_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb
index 13c7cec..62708a5 100644
--- a/app/controllers/events_controller.rb
+++ b/app/controllers/events_controller.rb
@@ -3,7 +3,7 @@ class EventsController < ApplicationController
# GET /events or /events.json
def index
- @events = Event.all
+ @events = Event.all.order(date: :asc)
end
# GET /events/1 or /events/1.json
@@ -25,7 +25,7 @@ class EventsController < ApplicationController
respond_to do |format|
if @event.save
- format.html { redirect_to event_url(@event), notice: "Event was successfully created." }
+ format.html { redirect_to events_path, notice: "Event was successfully created." }
format.json { render :show, status: :created, location: @event }
else
format.html { render :new, status: :unprocessable_entity }