Browse files

Can now remove users from project

  • Loading branch information...
1 parent 96f6d83 commit ba47f888f414ab89c6e2ebd65c68e587ece6044e @skalnik skalnik committed Jun 28, 2010
Showing with 14 additions and 4 deletions.
  1. +4 −3 app/controllers/memberships_controller.rb
  2. +10 −1 app/views/projects/show.html.erb
View
7 app/controllers/memberships_controller.rb
@@ -23,11 +23,12 @@ def update
end
def destroy
+ user = @membership.user
+ project = @membership.project
@membership.destroy
- respond_to do |format|
- format.js
- end
+ flash[:notice] = "#{user.login} has been removed"
+ redirect_to project
end
protected
View
11 app/views/projects/show.html.erb
@@ -172,7 +172,16 @@
<% if tendril.notifies.user == current_user %><%= link_to 'edit', notify_path(:id => tendril.notifies.id) %><% end %>
</li>
<% end %>
- </ul>
+ </ul>
+
+ <h2>Users</h2>
+ <ul>
+ <% @project.memberships.each do |membership| %>
+ <li>
+ <%= link_to membership.user.login, membership_path(membership), :confirm => 'Are you sure?', :method => :delete %>
+ </li>
+ <% end %>
+ </ul>
</div>
<% end %>

0 comments on commit ba47f88

Please sign in to comment.