How to use HTML ID in a ruby if statement condition
问题 I'm trying to render a form depending on which checkbox has been ticked. I want to use an if statement with the checkbox's id in the condition, but rails is throwing up an error 'undefined method tab1. Is there a way to target html in an if statement? thanks <input id="tab1" type="radio" name="tabs" checked> <label class="label-header" for="tab1"> UK Address</label> <input id="tab2" type="radio" name="tabs"> <label class="label-header"for="tab2"> International Address </label> <!-- <section