Created
June 4, 2009 16:58
-
-
Save jrichter/123707 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is neat. Here is my erb file. | |
<% content_for :sidebar do %> | |
<%= link_to 'New user', new_user_path %> | |
<% end %> | |
<h1>Listing users</h1> | |
<% @users.each do |user| %> | |
<% if user.sessions.size > 0 %> | |
<p class="logged_in"> | |
<% else %> | |
<p class="logged_out"> | |
<% end %> | |
Name: <%=h user.name %><br/> | |
Email: <%=h user.email %><br/> | |
Role: <%=h user.role %><br/> | |
LDAP? <%= user.is_ldap || "false" %><br/> | |
<%= link_to 'Show', user %> | | |
<%= link_to 'Edit', edit_user_path(user) %> | |
</p> | |
<% end %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And here is the same file in haml. | |
- content_for :sidebar do | |
= link_to 'New user', new_user_path | |
%h1 Listing users | |
- @users.each do |user| | |
%div{:class => user.sessions.size > 0 ? 'logged_in' : 'logged_out' } | |
Name: | |
= user.name | |
%br/ | |
Email: | |
= user.email | |
%br/ | |
Role: | |
= user.role | |
%br/ | |
LDAP? | |
= user.is_ldap || "false" | |
%br/ | |
= link_to 'Show', user | |
= link_to 'Edit', edit_user_path(user) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment