summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/groups_controller.rb2
-rw-r--r--app/views/groups/_users.html.erb9
2 files changed, 5 insertions, 6 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index c5f0b3e37..bcb25012d 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -125,7 +125,7 @@ class GroupsController < ApplicationController
def remove_user
@group = Group.find(params[:id])
- @group.users.delete(User.find(params[:user_id])) if request.post?
+ @group.users.delete(User.find(params[:user_id])) if request.delete?
respond_to do |format|
format.html { redirect_to :controller => 'groups', :action => 'edit', :id => @group, :tab => 'users' }
format.js { render(:update) {|page| page.replace_html "tab-content-users", :partial => 'groups/users'} }
diff --git a/app/views/groups/_users.html.erb b/app/views/groups/_users.html.erb
index ad6262249..310777dee 100644
--- a/app/views/groups/_users.html.erb
+++ b/app/views/groups/_users.html.erb
@@ -10,9 +10,7 @@
<tr id="user-<%= user.id %>" class="<%= cycle 'odd', 'even' %>">
<td class="user"><%= link_to_user user %></td>
<td class="buttons">
- <%= link_to_remote l(:button_delete), { :url => { :controller => 'groups', :action => 'remove_user', :id => @group, :user_id => user },
- :method => :post },
- :class => 'icon icon-del' %>
+ <%= link_to_remote l(:button_delete), { :url => group_user_path(@group, :user_id => user), :method => :delete }, :class => 'icon icon-del' %>
</td>
</tr>
<% end %>
@@ -26,14 +24,15 @@
<div class="splitcontentright">
<% users = User.active.not_in_group(@group).all(:limit => 100) %>
<% if users.any? %>
- <% remote_form_for(:group, @group, :url => {:controller => 'groups', :action => 'add_users', :id => @group}, :method => :post) do |f| %>
+ <% remote_form_for(@group, :url => group_users_path(@group), :html => {:method => :post}) do |f| %>
<fieldset><legend><%=l(:label_user_new)%></legend>
<p><%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>
<%= observe_field(:user_search,
:frequency => 0.5,
:update => :users,
- :url => { :controller => 'groups', :action => 'autocomplete_for_user', :id => @group },
+ :url => autocomplete_for_user_group_path(@group),
+ :method => :get,
:with => 'q')
%>