开发者

How to assign columns as dates in rails

开发者 https://www.devze.com 2022-12-13 02:40 出处:网络
Hi guys in Ruby on Rails I have a table with 7 columns such as Monday, Tuesday, Wednesday etc which hold times...

Hi guys in Ruby on Rails I have a table with 7 columns such as Monday, Tuesday, Wednesday etc which hold times...

I want these columns to be assigned to an actual day of the week so that if its tuesday the 开发者_运维问答tuesday columns data(times) is rendered etc how do i go about doing this thanks in advance.


record.send(Time.now.strftime("%A").downcase)

This will call the day of the week ("sunday" through to "saturday") on whatever record represents.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号