copy timeline here
This commit is contained in:
@ -49,6 +49,6 @@ class MembersController < ApplicationController
|
||||
# Only allow a list of trusted parameters through.
|
||||
def member_params
|
||||
params.require(:member).permit(:name, :public, :bio , :picture,
|
||||
:picture_cache , :arrived ,:left)
|
||||
:picture_cache , :arriving ,:leaving)
|
||||
end
|
||||
end
|
||||
|
11
app/controllers/timeline_controller.rb
Normal file
11
app/controllers/timeline_controller.rb
Normal file
@ -0,0 +1,11 @@
|
||||
class TimelineController < ApplicationController
|
||||
|
||||
def index
|
||||
@weeks = (params[:weeks] || "12").to_i
|
||||
@members = Member.visible_scope.
|
||||
where("leaving > ? " , Date.today).
|
||||
where("arriving < ? " , Date.today.at_beginning_of_month + @weeks.weeks).
|
||||
order(:arriving).
|
||||
page(1).per(50)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user