improve events
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user