Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Can now remove users from project

  • Loading branch information...
commit ba47f888f414ab89c6e2ebd65c68e587ece6044e 1 parent 96f6d83
@skalnik skalnik authored
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 %>
Please sign in to comment.
Something went wrong with that request. Please try again.