fix event ordering
This commit is contained in:
parent
cc12f4a5a3
commit
358e95f701
@ -2,7 +2,7 @@ class EventsController < ApplicationController
|
||||
before_action :set_event, only: %i[ show edit update destroy ]
|
||||
|
||||
def index
|
||||
@events = Event.where("start_date > ? " , Date.today - 3.days)
|
||||
@events = Event.where("start_date > ? " , Date.today - 3.days).order(:start_date)
|
||||
end
|
||||
|
||||
def show
|
||||
|
@ -3,7 +3,7 @@
|
||||
= link_to "See all events" , "/events" , class: :underline
|
||||
.flex.justify-center
|
||||
.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-4
|
||||
- one, two , three, four = *Event.where("start_date > ? " , Date.today - 3.days).limit(4)
|
||||
- one, two , three, four = *Event.where("start_date > ? " , Date.today - 3.days).limit(4).order(:start_date)
|
||||
%div= render( "events/event_small" , event: one) if one
|
||||
.hidden.md:block= render( "events/event_small" , event: two) if two
|
||||
.hidden.lg:block= render( "events/event_small" , event: three) if three
|
||||
|
Loading…
Reference in New Issue
Block a user