Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <td title="id:<%= alert.id %>">Hello</td>
  2.  
  3. def admin?
  4. # check if this user is an admin
  5. end
  6.  
  7. <%= content_tag :td, 'Hello', title: ("id:#{alert.id}" if admin?) %>
  8.  
  9. def admin?
  10. # check if this user is an admin
  11. end
  12.  
  13. def generate_title(this)
  14. if admin?
  15. "id:#{this}"
  16. end
  17. end
  18.  
  19. <td title="<%= generate_title(alert.id) %>">Hello</td>
  20.  
  21. <td <%="title="id:#{alert.id}"" if admin?%>>Hello</td>
  22.  
  23. <% if admin? %>
  24. <td title="id:<%= alert.id %>">Hello</td>
  25. <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement