rails tag中的name加入参数

两种不同的效果,之相差在""和''
for day in @days
1.
<%= select_tag('works['+day.to_s+']', ...%>
产生的html:
<select  id="works[1]" name="works[1]">...</select>
...
2.
<%= select_tag("works['+day.to_s+']", ...%>
产生的html:
<select id="works['+day.to_s+']" name="works['+day.to_s+']">...</select>
...

你可能感兴趣的:(html,Rails)