I'm using Bootstrap's radio input, and want to be able to set the checked state of a set of radio conditionally, using embedded ruby, based on some instance variable value.
I want to be able to do the following:
<input type="radio" name="type" id="all" value="all" checked="<%= 'true' if @instance_variable %>">
However, if the checked attribute is included in the input tag, the radio input is checked, regardless of the content of the attribute, even if I set checked to be false.
I would like to avoid using jQuery to achieve this.
Is there a way to achieve what I'm trying to do with embedded ruby?