2009/6/18 sinker <[email protected]>: > > Thanks, that totally makes sense. I just tossed it in the view to make > sure it worked. Moved it into the index controller and the final looks > like this: > > if (1..5).include?(Date.today.wday) > else > redirect_to :controller => 'libraries', :action => 'index' > end >
Have you considered the time zone issue if this is for a public website? Does Date.today know the timezone of the user? If not and it works in the local timezone of the server (or maybe the rails timezone setting, or UTC) then if a user is in a different timezone his weekend may be up to 23 hours adrift from that (depending on the server/rails timezone setting). Colin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

