Hi everyone, I actually have two questions... first one, it happens I wrote a few helper under helper directory, let say a_helper.rb Then in a_controller.rb there is a method I would like to use the helpers inside a_helper.rb. I found I cannot use anything from a_helper.rb as they cannot recognize the variables there, right now I use a really dumb way, to repeat all the methods inside helper to in a_controller. I guess there is a better way if anyone can tell me please? the 2nd question, i have @work_times defined inside user_controller that collects a range of work_time based on a period of time. Now in view I would like to use part of the @work_times instead of all of instances at one time;(but I have to use all, so if @work_times has 28 days I need to use 1-7 days at one time, then 8-13days at second time...14-20 at 3rd and 21-28 finally and it has to use all of them in one time, as I am formating a table that looks like below: date | check_in | check_out 21 | 9:00 | 18:00 22 | 9:30 | 19:00 . . 20 |9:00 |20:00 both the data under date, and check_in/check_out is dynamically determined, so I need to construct a conditions like i=0 when i<30 (assume a month has 30 days) date=21 check_in = @work_times[0].check_in check_out = @work_times[0].check_out .... date=22 check_in = @work_times[1].check_in check_out = @work_times[1].check_out what is the best way to do it? I find I can use @work_times[0], @work_times[1] ...to access the instance but I cannot do something like i =0, @work_time[i] =.... as the i is not recognized as an integer inside the []. What is the best approach or ways to do something like this? Thank you for your time and any suggestions. Sammy --------------------------------- DO YOU YAHOO!? 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails