mardi 19 janvier 2016

How to set a checkbox in Rails only as a visual representation of the data (Read Only)?

I have a boolean value on a task model I want to show the value in a checkbox without the possiblity of changing the checkbox value.

How can I achieve this? Why doesn't my code work?

<%= form_for(@task) do |f| %>
 <%= f.check_box :important, {}, disabled="disabled" %>
<% end %>

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire