Kenneth McDonald
2008-Nov-14 03:28 UTC
Question: displaying uneditable boolean data as a check box?
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi everyone. Is there a reasonably easy way, in rails, to display a boolean column in, say, a model index view, and have it show up as an uneditable check box? Right now it''s showing up as just the string ''true'' or ''false'' in the index view, while it shows up as a check box in an editing or creation view. It would be nice to have a unified view.<br><br>Thanks in advance,<br>Ken<br><br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. <br> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en<br> -~----------~----~----~----~------~----~------~--~---<br> </body></html> <br>
Craig Demyanovich
2008-Nov-15 01:03 UTC
Re: Question: displaying uneditable boolean data as a check box?
You can pass the :disabled option to FormTagHelper#check_box_tag or FormHelper#check_box to render an uneditable checkbox. Regards, Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---