开发者

Rails: Populate collection_select using loop for days of the month

开发者 https://www.devze.com 2023-03-17 01:43 出处:网络
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..

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

精彩评论

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