これは私がRubyonRailsで構築したいものです:
<tr>
<td>attribute0</td>
<input name="1" type="radio" value="1" />
<input name="1" type="radio" value="2" />
<input name="1" type="radio" value="3" />
<input name="1" type="radio" value="4" />
<input name="1" type="radio" value="5" />
<td>attribute1</td>
</tr>
ラジオボタンの数は可変である必要があります。content_tagメソッドを使用してHTMLタグを生成しています。
@template.content_tag(:tr, @template.content_tag(:td, ... ))
次のようなステートメントを追加することは可能ですか?
for i in 1..5 do
@template.tag(:input, :type => 'radio', :value => i, :name => options[:name])
end
content_tagのパラメータとして?