我使用的是Rails 2.3.8.我的代码:
<%= f.radio_button :status,"draft" %> <%= f.label :status,"Draft" %> <%= f.radio_button :status,"published" %> <%= f.label :status,"Published" %>
输出:
<input id="shop_status_draft" name="shop[status]" type="radio" value="draft" /> <label for="shop_status">Draft</label> <input checked="checked" id="shop_status_published" name="shop[status]" type="radio" value="published" /> <label for="shop_status">Published</label>
很明显,标签没有正确地与我的单选按钮相关联.我想使标签与单选按钮ID相同.我该怎么纠正?
谢谢.