I am generating an input like this:
<%= form.radio_button("ans", ans.num.to_s) %>
The generated html is:
<input id="myform_ans_1" name="myform[ans]" type="radio" value="1" />
But what I am looking for is this html:
<input id="myform_ans_1" name="myform[ans]" type="radio" value="1">Some Text</input>
Is there an option that I can pass into the radio_button method render the desired html?
As I understand the optional options hash that you can pass to radio_button, this only adds attributes to the html tag.
If your app will involve a lot of forms you should definitely take a look at formtastic. You can define your forms like so:
This will generate all the markup required for html forms including fieldsets, legends, inputs and labels.