Skip to content

Instantly share code, notes, and snippets.

@tomafro
Created October 13, 2009 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomafro/209158 to your computer and use it in GitHub Desktop.
Save tomafro/209158 to your computer and use it in GitHub Desktop.
Before:
<ul class="actions">
<li><%= link_to content_tag(:span, 'Edit group'), edit_group_path(@group), :class => 'btn' if current_user.group_admin?(@group) %></li>
<li><%= link_to content_tag(:span, 'Start a new discussion'), new_group_discussion_path(@group), :class => 'btn' if @group.public? || @group.members.include?(current_user) %></li>
<li><%= link_to content_tag(:span, 'Start a shared document'), new_group_shared_document_path(@group), :class => 'btn' %></li>
<li><%= link_to content_tag(:span, 'Invite users to join this group'), new_group_invitation_path(@group), :class => 'btn' if current_user.andand.group_admin?(@group) %></li>
</ul>
After:
<% sidebar_action_list do |list| %>
<%= list.action 'Edit group', edit_group_path(@group) if current_user.group_admin?(@group) %>
<%= list.action 'Start new discussion', new_group_discussion_path(@group) if @group.public? %>
<%= list.action 'Start a shared document', new_group_shared_document_path(@group) %>
<%= list.action 'Invite users to join this group', new_group_shared_document_path(@group) if current_user.andand.group_admin?(@group) %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment