开发者

Rails - Validating date_select helper

开发者 https://www.devze.com 2023-03-05 13:35 出处:网络
I\'m using date_select helper which passes params like: date_of_birth(1i) date_of_birth(2i) date_of_birth(3i)

I'm using date_select helper which passes params like:

date_of_birth(1i)
date_of_birth(2i)
date_of_birth(3i)

I would like to validate using validates_presence_of but returns the following error when blank is selected from the d开发者_开发问答ropdowns:

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.empty?


Looks like jQuery was the right solution for me. :)

0

精彩评论

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