By default, when displaying a boolean column, you get either a
checkbox, or select list, depending on whether or not the column
allows null. This is very handy.
However, in the select list, the displayed options are "True",
"False", which may not always suit. I tried to override these by
providing an array of arrays as an option, like below:
config.columns[:parent_send_email].form_ui = :select
config.columns[:parent_send_email].options[:options] = [ ['No,
only teachers and class parents can send messages to a classroom',
false], ['Yes, a parent can send an email to their childs whole
class', true]]
This works fine for the true option, but for the false option, this
renders the following:
<select name="record[parent_send_email]"
id="record_parent_send_email_13" class="parent_send_email-
input"><option value="No, only teachers and class parents can send
messages to a classroom">No, only teachers and class parents can send
messages to a classroom</option>
<option value="true">Yes, a parent can send an email to their childs
whole class</option></select>
As you can see, the value of the false option gets set to the string,
not to "false"
Is this as expected? Is there a way to provide custom descriptions in
a boolean select field?
Thank you for your help.
Tom
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.