Carl Franks wrote:
No, 'default' would be ignored (lost) during options().
Only 1 radio item's value can match the default.
It should be:
$self->options(
[ map {
{ value => $_->id,
label => ucfirst $_->name,
attributes => { id => 'role_' . $_->id, },
label_attributes => { for => 'role_' . $_->id, },
}
} $roles->all
]
);
$self->default( $default );
Boy, is my face red.
Some of that code was held-over from when a user could have multiple
roles -- that is no longer the case. The following worked as desired:
$self->default( eval { $c->stash->{ account }->roles->first->id } );
Muchos gracias, Carl.
-Brian
_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu