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.
If startdate is of type Date, why not just do,
@attendance.signin = @leafe.startdate+i
@attendance.signout = @leafe.startdate+i
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