Dear Friends, I have values in table for duties assigned on certain days ranges, e.g Monday to Tuesday, Wednesday to Friday.
Now I want to show the duties assigned to a person on main screen if the day of current date is in the range of weekdays assigned to him/her. I tried the below but no idea. def show_all_rosters @dw = Time.now.strftime('%w') day = Proc.new { |d| Date::DAYNAMES[d] } @dw1 = day.call(6) week_days = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] @ww = week_days[1] @dd1 = Date.today @dd2 = Date.tomorrow @dd3 = Date.today + 1 @theday =Time.now.strftime('%w').downcase @rosterduties = RosterDuty.find(:all,:conditions=>["lower(duty_day1) = :theday or lower(duty_day2)=:theday",{:theday => @theday}]) end Thanks in advance. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fb30265469e76584cffa75e543ae7b77%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.