Reputation:
I'm using Rails 5. How do I create a checkbox that is disabled (not clickable) by default? I tried
<%= f.check_box :mybox, :tabIndex => '1', :enabled => false %>
but the resulting checkbox is still rendered as enabled.
Upvotes: 0
Views: 837
Reputation: 3018
You can use the disabled
attribute:
<%= f.check_box :mybox, tabIndex: '1', disabled: true %>
Upvotes: 3