I have a code for looping days.this to make leaves. I want column signin and signout on attendance will filling automatically start at startdate and end at enddate.
Why you using for loop? It looks like javacode. Use instead block with range like:
(Time.now.beginning_of_day.to_i..Time.now.to_i).step(3600) do |n|#step one hour for example
@attendance = Attendance.new
.......
@attendance.signin = @leafe.startdate
@attendance.signout = @leafe.startdate + n # u can change time interval to any what you want
end