Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <td title="id:<%= alert.id %>">Hello</td>
- def admin?
- # check if this user is an admin
- end
- <%= content_tag :td, 'Hello', title: ("id:#{alert.id}" if admin?) %>
- def admin?
- # check if this user is an admin
- end
- def generate_title(this)
- if admin?
- "id:#{this}"
- end
- end
- <td title="<%= generate_title(alert.id) %>">Hello</td>
- <td <%="title="id:#{alert.id}"" if admin?%>>Hello</td>
- <% if admin? %>
- <td title="id:<%= alert.id %>">Hello</td>
- <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement