From 9c0ae239270ebb0ec487f37a28d4371716f131d4 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 13 Nov 2012 20:29:59 +0600 Subject: [PATCH] small refactoring --- app/controllers/groups/members_controller.rb | 4 ++-- app/views/groups/members/index.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/groups/members_controller.rb b/app/controllers/groups/members_controller.rb index 786c9bc3a..77d97ddc4 100644 --- a/app/controllers/groups/members_controller.rb +++ b/app/controllers/groups/members_controller.rb @@ -38,9 +38,9 @@ class Groups::MembersController < Groups::BaseController end def add - @user = User.find_by_uname(params[:user_id]) + @user = User.find_by_uname(params[:user_uname]) if !@user - flash[:error] = t("flash.collaborators.wrong_user", :uname => params[:user_id]) + flash[:error] = t("flash.collaborators.wrong_user", :uname => params[:user_uname]) elsif parent.add_member(@user, params[:role]) flash[:notice] = t("flash.members.successfully_added") else diff --git a/app/views/groups/members/index.html.haml b/app/views/groups/members/index.html.haml index 25b05239d..2ce755b65 100644 --- a/app/views/groups/members/index.html.haml +++ b/app/views/groups/members/index.html.haml @@ -25,7 +25,7 @@ .hr.top = form_tag add_group_members_path(parent) do - .admin-search= autocomplete_field_tag 'user_id', params[:user_id], autocomplete_user_uname_autocompletes_path#, :id_element => '#member_id_field' + .admin-search= autocomplete_field_tag 'user_uname', params[:user_uname], autocomplete_user_uname_autocompletes_path .admin-role .lineForm= select_tag 'role', options_for_collaborators_roles_select .both