I have a model for Event that I would like to have a user set date.
Is :time or :timestamp more appropriate? And is date_select the best form helper to use here? Or is there a nice gem for selecting from a calendar or something?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d recommend creating your migration with a field called
start(or whatever seems appropriate to you) with a type of:datetime(see here).From the view perspective, the ‘vanilla’ approach would be to use
datetime_select. Info here.You can probably find a lot prettier views with an unobtrusive pop-up calendar in JavaScript. I don’t have any particular recommendations in this area.