improve events

This commit is contained in:
Torsten
2023-06-12 15:47:54 +03:00
parent d2eaacaaad
commit 15ccc5eedb
19 changed files with 100 additions and 49 deletions

View File

@ -2,7 +2,7 @@ class EventsController < ApplicationController
before_action :set_event, only: %i[ show edit update destroy ]
def index
@events = Event.all
@events = Event.where("start_date > ? " , Date.today - 3.days)
end
def show
@ -55,6 +55,6 @@ class EventsController < ApplicationController
# Only allow a list of trusted parameters through.
def event_params
params.require(:event).permit(:name, :text, :start_date, :end_date,
:profile_id, :picture, :picture_cache)
:profile_id, :picture, :picture_cache , :info)
end
end

View File

@ -1,8 +1,10 @@
class ProfilesController < ApplicationController
before_action :set_profile, only: %i[ show edit update destroy ]
def index
@profiles = Profile.page params[:page]
def teachers
@profiles = Profile.where(kind: :teacher).page( 1 ).per(50)
@header = "Meet Hub Feenix teachers and organizers"
render :index
end
def show
@ -52,6 +54,7 @@ class ProfilesController < ApplicationController
# Only allow a list of trusted parameters through.
def profile_params
params.require(:profile).permit(:name, :bio, :picture,:picture_cache, :kind)
params.require(:profile).permit(:name, :bio, :picture,:picture_cache,
:kind , :info)
end
end