다음 표는 formtastic 형식으로 포함 된 양식 (semantic_form_for)입니다. (루비에 의해 생성되는 모든 내가 물어 나타하지만 테이블이 심하게 망가됩니다 본질적으로, 태그가 형성되지 얻을 마십시오.왜 내 html이 잘못 형성 되었습니까?
테이블 헤더가 제대로 그려 얻을
전달받을 14 개에 구입 가능 오브젝트가 존재하며, 그들은 1 또는 2의 시간 값을 갖는 교대, 그래서 이것은 단지 정말 불허하지만 고칠 아마 간단하다 ...
<table class="availability_table">
<tr>
<th>Date</th>
<th>Early</th>
<th>Late</th>
</tr>
<% f.fields_for :available_dates do |ad| %>
<% if ad.object.time == 1 #if this is an early shift, then start the new row %>
<tr><td><%= ad.object.date.strftime('%a, %b %d, %Y') %></td>
<td><%= ad.collection_select(:availability , LookupAvailability.all.collect, :id, :name) %></td>
<% else #otherwise end the row with just a box%>
<td><%= ad.collection_select(:availability , LookupAvailability.all.collect, :id, :name) %></td></tr>
<% end %>
<% end %>
</table>
을 내가 말한 그래서 같은 형태의 기능을 제대로하고, 객체는 모두 업데이트됩니다 올바르게 표시되고 모두 표시됩니다. HTML이 제대로 출력되지 않아 내 테이블이 모두 엉망입니다. 피!
브릴리언트. 고맙습니다. =) – alkaloids