6

デバイスの招待状を送信するときに、ドメインだけでなく招待状を送信したユーザーを表示できるようにしたいのですが、これに関するドキュメントを見つけることができませんでした。

この名前を表示する必要がある2つの場所は、招待メールにあります-

(「誰か」の代わりに)

<p>Hello <%= @resource.email %>!</p>

<p>Someone has invited you to <%= root_url %>, you can accept it through the link below.</p>

<p><%= link_to 'Accept invitation', accept_invitation_url(@resource, :invitation_token => @resource.invitation_token) %></p>

<p>If you don't want to accept the invitation, please ignore this email.<br />
Your account won't be created until you access the link above and set your password.</p>

およびパスワードの設定ページ。

<h4>You're seeing this page because someone has invited you to the site</h4>
<%= simple_form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :put } do |f| %>
  <%= devise_error_messages! %>
  <%= f.hidden_field :invitation_token %>
<div class="row">  
  <div class="signup_well span3 offset1">
    <legend><%= t 'devise.invitations.edit.header' %></legend>
    <%= f.input :password %>
    <%= f.input :password_confirmation %>
    <%= hidden_field_tag :token_key, resource.invitation_token %>
    <%= f.submit t("devise.invitations.edit.submit_button") %>
  <% end %>
</div>

これを行うための最良のアプローチに関するドキュメントを見落とす可能性があります。あなたの助けは多くの欲求不満を救います。ありがとうございました。

4

1 に答える 1

5

これは機能するはずです:<%= @ resource.invited_by.first_name%>。

于 2013-01-29T13:34:35.493 に答える