0

如何将某个值(电子邮件地址)从客户信息页面(我在其中查看所有客户信息)传递到“整体”联系表格,该表格可在“myhost.com/contact”下访问。

我想要这样的东西:

<%= link_to 'Send email to customer', contact_path %>

与要传递的特定电子邮件地址。先感谢您。

4

1 回答 1

1

您可以将电子邮件地址作为参数传递,如以下伪代码所示:

<%= link_to "Send Email to Customer", contact_path(:email_address => customer.email) %>

其中 customer 是您要通过电子邮件发送的客户对象。

您还可以发送客户 ID 并使用该 ID 在联系页面中获取客户的电子邮件。

<%= link_to "Send Email to Customer", contact_path(:customer => customer.id) %>
于 2013-02-27T15:13:40.730 回答