为什么当我尝试发送这三个参数(recipients_emails)时出现错误:
FreeRegistrationCouponsController#send 中的参数错误
参数数量错误(2 代表 0) Rails.root:/Users/regedarek/code/wifiname
应用程序跟踪 | 框架跟踪 | 完整跟踪 app/controllers/free_registration_coupons_controller.rbin `send'
我做错了什么?
<div class="span6">
<b>Give three of your friends a free registration</b>
<%= form_tag :controller => 'free_registration_coupons', :action => "send" do %>
<%= label_tag :recipient_email_1 %>
<%= text_field_tag :recipient_email_1 %>
<%= label_tag :recipient_email_2 %>
<%= text_field_tag :recipient_email_2 %>
<%= label_tag :recipient_email_3 %>
<%= text_field_tag :recipient_email_3 %>
<%= submit_tag %>
<% end %>
</div>
class FreeRegistrationCouponsController < ApplicationController
def send
@sender_id = current_user.id
binding.pry
redirect_to root_path
end
end
resources :free_registration_coupons do
collection do
get 'send'
post 'send'
end
end