I have a checkbox:
<%= check_box(:day, :monday, {:disabled => ''''} ,
(day.monday == true ?
{:checked => ''checked''} : {:checked => false} )) %>
It is disabled allright, but it is always uncecked. Is this supposed to
happen. It looks like
(day.monday == true ? {:checked => ''checked''} : {:checked
=> false} )
is not working if disabled is used...
--
Posted via http://www.ruby-forum.com/.
Danger Stevens
2006-May-03 19:55 UTC
[Rails] Re: disabled check_box does not work as expected?
oomtuinstoel <oomtuinstoelNO@...> writes:> <%= check_box(:day, :monday, {:disabled => ''''} , (day.monday == true ? > {:checked => ''checked''} : {:checked => false} )) %> > > It is disabled allright, but it is always uncecked. Is this supposed to > happen. It looks like > > (day.monday == true ? {:checked => ''checked''} : {:checked => false} ) > > is not working if disabled is used... >I haven''t looked at the rails code to verify this, but it seems like it should be: <%= check_box(:day, :monday, {:disabled => '''', :checked => day.monday == true ? ''checked'' : false } )) %>
oomtuinstoel
2006-May-04 11:35 UTC
[Rails] Re: disabled check_box does not work as expected?
>Danger Stevens wrote: > I haven''t looked at the rails code to verify this, > but it seems like it should be: > <%= check_box(:day, :monday, {:disabled => '''', :checked => > day.monday == true ? ''checked'' : false } )) %><%= check_box(:day, :monday, (day.monday == true ? {:checked => ''checked'', :disabled => ''''} : {:checked => false, :disabled => ''''} ) ) %> dit the trick! Thanks for your pointer! -- Posted via http://www.ruby-forum.com/.