I'm trying to use a select list for a boolean field in my model. I
want there to be three values in the list: nil, true, and false. Here
are the snippets of code I have so far:
The problem I'm running into is that if someone selects '--select
one--' in the drop-down and submits the form, my app interprets the '--
select one--' as false (it's values is an empty string in the html).
But that didn't work either. Does anyone have any ideas? Also, I can't
use a checkbox for this app, since I need to know whether the value is
true, false, or unknown.
I'm trying to use a select list for a boolean field in my model. I
want there to be three values in the list: nil, true, and false. Here
are the snippets of code I have so far:
The problem I'm running into is that if someone selects '--select
one--' in the drop-down and submits the form, my app interprets the '--
select one--' as false (it's values is an empty string in the html).
But that didn't work either. Does anyone have any ideas? Also, I can't
use a checkbox for this app, since I need to know whether the value is
true, false, or unknown.
Regards,
Eric
Hi
Try this one
[['--select one--', ''], ['Yes', true], ['No', false]]
might be you will get value nil when user select 'select one'
Thanks
Brijesh Shah