Skip to content

Instantly share code, notes, and snippets.

@dlikhten
Forked from workmad3/original.html.erb
Created May 22, 2010 21:07

Revisions

  1. dlikhten revised this gist May 22, 2010. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions test.html.erb
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    <% suffix = [ '', '_dual', '_triple' ] %>
    <% suffix = [ '_triple', '_dual', '' ] %>
    <ul class="profile_info<%= yield :suffix %>">
    <li><%= link_to(fb_name(owner, :use_you => false, :linked => false), owner) %></li>
    <% if local_assigns.include?(:phone) %>
    <li class="phone"><%= phone %></li>
    <% suffix.shift %>
    <% suffix.pop %>
    <%end%>
    <% if local_assigns.include?(:location) %>
    <li><%= location %></li>
    <% suffix.shift %>
    <% suffix.pop %>
    <%end%>
    </ul>
    <% content_for :suffix {suffix.shift} %>
    <% content_for :suffix {suffix.pop} %>
  2. dlikhten revised this gist May 22, 2010. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions test.html.erb
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    <% mode = 0 %>
    <% suffix = [ '', '_dual', '_triple' ] %>
    <ul class="profile_info<%= yield :suffix %>">
    <li><%= link_to(fb_name(owner, :use_you => false, :linked => false), owner) %></li>
    <% if local_assigns.include?(:phone) %>
    <li class="phone"><%= phone %></li>
    <% mode += 1 %>
    <% suffix.shift %>
    <%end%>
    <% if local_assigns.include?(:location) %>
    <li><%= location %></li>
    <% mode += 1 %>
    <% suffix.shift %>
    <%end%>
    </ul>
    <% content_for :suffix {[ '', '_dual', '_triple' ][ mode ] } %>
    <% content_for :suffix {suffix.shift} %>
  3. @workmad3 workmad3 renamed this gist May 22, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @workmad3 workmad3 revised this gist May 22, 2010. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions gistfile1.builder
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,4 @@
    <% mode += 1 %>
    <%end%>
    </ul>
    <%
    content_for :suffix do
    [ '', '_dual', '_triple' ][ mode ]
    end
    %>
    <% content_for :suffix {[ '', '_dual', '_triple' ][ mode ] } %>
  5. @workmad3 workmad3 revised this gist May 22, 2010. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.builder
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,8 @@
    <% mode += 1 %>
    <%end%>
    </ul>
    <%
    content_for :suffix do
    [ '', '_dual', '_triple' ][ mode ]
    end
    %>
  6. @workmad3 workmad3 renamed this gist May 22, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. @workmad3 workmad3 revised this gist May 22, 2010. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,15 @@
    <% mode = 0 %>
    <ul class="profile_info<%= yield :suffix %>">
    <li><%= link_to(fb_name(owner, :use_you => false, :linked => false), owner) %></li>
    <% if local_assigns.include?(:phone) %>
    <li class="phone"><%= phone %></li>
    <% mode += 1 %>
    <%end%>
    <% if local_assigns.include?(:location) %>
    <li><%= location %></li>
    <% mode += 1 %>
    <%end%>
    </ul>
    content_for :suffix do
    mode = 0
    mode += 1 if local_assigns.include?(:phone)
    mode += 1 if local_assigns.include?(:location)
    [ '', '_dual', '_triple' ][ mode ]
    end
  8. @workmad3 workmad3 revised this gist May 22, 2010. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    <ul class="profile_info">
    <ul class="profile_info<%= yield :suffix %>">
    <li><%= link_to(fb_name(owner, :use_you => false, :linked => false), owner) %></li>
    <% if local_assigns.include?(:phone) %>
    <li class="phone"><%= phone %></li>
    @@ -7,3 +7,9 @@
    <li><%= location %></li>
    <%end%>
    </ul>
    content_for :suffix do
    mode = 0
    mode += 1 if local_assigns.include?(:phone)
    mode += 1 if local_assigns.include?(:location)
    [ '', '_dual', '_triple' ][ mode ]
    end
  9. @workmad3 workmad3 created this gist May 22, 2010.
    9 changes: 9 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <ul class="profile_info">
    <li><%= link_to(fb_name(owner, :use_you => false, :linked => false), owner) %></li>
    <% if local_assigns.include?(:phone) %>
    <li class="phone"><%= phone %></li>
    <%end%>
    <% if local_assigns.include?(:location) %>
    <li><%= location %></li>
    <%end%>
    </ul>