ubuntu, ror, jQuery, css, website memo
太嫩, 沒啥心得, 用來紀錄每天學的
2009年7月10日 星期五
content_tag_for, div_for
content_tag_for, div_for
<br /> <% content_tag_for(:tr, @person) do %><br /> <td><%=h @person.first_name %></td><br /> <td><%=h @person.last_name %></td><br /> <% end %><br />#產生<br /><tr id="person_123" class="person">....</tr><br /><br /><br />#If you require the HTML id attribute to have a prefix, you can specify it: <br /> <% content_tag_for(:tr, @person, :foo) do %><br />#產生<br /><tr id="foo_person_123" class="person">...<br /><br /><br /><% content_tag_for(:li, @person, :class => "bar") %>...<br />#產生<br /> <li id="person_123" class="person bar">...<br /><br /><br /><br /><% div_for(@person, :class => "foo") do %><br /> <%=h @person.name %><br /><% end %><br />#產生<br /><div id="person_123" class="person foo"> Joe Bloggs </div><br />
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言