Ruby on rails Rails设计了一个不可侵犯的功能,可以同时向多个电子邮件发送邀请

Ruby on rails Rails设计了一个不可侵犯的功能,可以同时向多个电子邮件发送邀请,ruby-on-rails,ruby,foreach,devise,devise-invitable,Ruby On Rails,Ruby,Foreach,Devise,Devise Invitable,我正在尝试创建一个foreach循环,以便能够为添加到文本框中的每个电子邮件地址创建invitaion_令牌,并发送所有电子邮件 new.html.erb <%= simple_form_for resource, :as => resource_name, :url => user_invitation_path(), :html => {:method => :post} do |f| %> <

我正在尝试创建一个foreach循环,以便能够为添加到文本框中的每个电子邮件地址创建invitaion_令牌,并发送所有电子邮件

new.html.erb

              <%= simple_form_for resource, :as => resource_name, :url => user_invitation_path(), :html => {:method => :post} do |f| %>
               <%= devise_error_messages! %>

              <div class="form-group">

              <% resource.class.invite_key_fields.each do |field| -%>
               <%= f.input :email, :class => "input-txt form-control" %><br />

              <% end -%>

               <%= f.submit t("devise.invitations.new.submit_button"), :id => "send-btn", :class => "btn btn-success" %>
              <% end %>

如何添加“email”,一个被逗号分隔的字符串?或者有几个文本框(每封邮件一个)?在控制器中调用
yield
?这是一个神奇的设计吗?我要做一个文本框,在这里它们被逗号分开。是的,收益是设计魔法code@user3443619当前位置我也有同样的问题,我是rails新手。那么,如何一次发送多个邀请呢。如何在params中传递电子邮件?我的问题是:
  def create
   self.resource = invite_resource

   if resource.errors.empty?
    yield resource if block_given?
    set_flash_message :notice, :send_instructions, :email => self.resource.email if self.resource.invitation_sent_at
    redirect_to root_path
   else
    respond_with_navigational(resource) { render :new }
   end
  end