Guest User

Untitled

a guest
Feb 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <% cache(:action => :sumpin, :id => @root_blah.id, :part => 'topfoos') do -%>
  2. <ul class="topfoos">
  3. <% position = 1 %>
  4. <% @top_foos_this_blah.each do |foo| -%>
  5. <li class="top<%= position %>">
  6. <%= link_to truncate(foo.title, 20), {:action => :foo_detail,
  7. :id => foo} %>
  8. </li>
  9. <% position += 1 %>
  10. <% end -%>
  11. </ul>
  12. <% end # cache topfoos -%>
  13.  
  14. <% cache(:action => :sumpin, :id => @root_blah.id, :part => 'blahs') do -%>
  15. <ul class="blahs">
  16. <% position = 1 %>
  17. <% @blahs.each do |blah| -%>
  18. <% @blah_id = "blah_" + blah.id.to_s %>
  19. <li id="<%= @blah_id %>" class="<%= cycle('dk', 'lt') %>">
  20. <% if blah.children.size > 0 -%>
  21. <%= link_to_remote blah.title, {:url => {:action => :list,
  22. :id => blah},
  23. :method => :get},
  24. {:class => 'blah'} %>
  25. <% else -%>
  26. <%= link_to blah.title, {:action => :list_foos,
  27. :id => (blah.title_urlfriendly + '.html')},
  28. {:class => 'link'} %>
  29. <% end -%>
  30. </li>
  31. <% position += 1 %>
  32. <% end -%>
  33. </ul>
  34. <% end # cache blahs -%>
Add Comment
Please, Sign In to add comment