Forum: Ruby on Rails Question: displaying uneditable boolean data as a check box?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Kenneth McDonald (Guest)
on 2008-11-15 02:34
(Received via mailing list)
<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 &quot;Ruby on Rails: Talk&quot; group. <br> To post to this
group, send email to removed_email_address@domain.invalid <br> To
unsubscribe from this group, send email to
removed_email_address@domain.invalid <br> For more options,
visit this group at
http://groups.google.com/group/rubyonrails-talk?hl...
-~----------~----~----~----~------~----~------~--~---<br>
</body></html>
<br>
Craig D. (Guest)
on 2008-11-15 03:03
(Received via mailing list)
You can pass the :disabled option to FormTagHelper#check_box_tag or
FormHelper#check_box to render an uneditable checkbox.

Regards,
Craig
This topic is locked and can not be replied to.