开发者

Rails multiple select boxes for one database field

开发者 https://www.devze.com 2023-01-24 00:52 出处:网络
Okay so I am creating a web app thats essentially a workout journal. I created a database table for each entry that holds the date, workoutname, exercises, etc... I was wondering if in my form for cre

Okay so I am creating a web app thats essentially a workout journal. I created a database table for each entry that holds the date, workoutname, exercises, etc... I was wondering if in my form for creating a new entry I can create 3 drop down lists for the date开发者_JAVA百科 - day, month, and time and have each of their values be combined to form the one date field (a string) in my entry table.


<%= f.datetime_select :workout_at %>

does that for you. If you need to do that manually inspect the html output this has and mimic it in your code. See also http://apidock.com/rails/ActionView/Helpers/DateHelper/datetime_select.

0

精彩评论

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