开发者

Rails: Populate collection_select using loop for days of the month

I want a collection_select that has 1 - 31 in it for the days in the month. Is there an easy way to create this loop to populate my 开发者_运维知识库collection_select?


collection_select :aaa, :bbb, (1..31).to_a, :to_s, :to_s

Update:

Actually, all you need is:

collection_select :aaa, :bbb, 1..31, :to_s, :to_s
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜