I have a field in an app that currently allows admins of Groups to invite other Users (to the group). It works for a single value, but I'm wondering how to adjust it so that it allows the admin to enter multiple Users separated by commas into the field.
# form in view
<%= form_tag({:controller => "group_members", :action => "invite_user"}, :method => "post") do %>
<%= hidden_field_tag 'group_id', @group.id%>
<%= text_field_tag :user_name %>
<%= submit_tag "Invite" %>
<% end %>
# group_members_controller
def invite_user
@user = User.find_by_user_name(params[:user_name])
@group_member = GroupMember.create!(:status=>"invited", :user_id=>@user.id, :group_id => params[:group_id], :token => SecureRandom.urlsafe_base64)
redirect_to :back, notice: "#{@user.user_name} has been invited to your group"
end