Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's a number of problems you need to fix:</p> <p>Add this line to one of your config blocks (either in <code>environment.rb</code> or each of the files in <code>config/environment</code>):</p> <pre><code>config.action_mailer.default_url_options = {:host =&gt; 'somewhere.com'} </code></pre> <p>In <code>app/models/invitation.rb</code> on line 3 you have call <code>attr_accessible :recipient_email</code> this will prevent you from mass assigning the sender. You should change it to this:</p> <pre><code>attr_accessible :recipient_email, :sender, :sender_id </code></pre> <p>Also <code>invitations_controller.rb</code> should look like this:</p> <pre><code>class InvitationsController &lt; ApplicationController before_filter :require_analyst def new @invitation = Invitation.new end def create @invitation = Invitation.new(params[:invitation]) @invitation.sender = current_analyst if @invitation.save flash[:notice] = "Thank you, invitation sent." redirect_to root_url else render :action =&gt; 'new' end end end </code></pre> <p>You really can't send an invitation unless you're logged in (because you need a sender, which in this case is an <code>current_analyst</code> not <code>@current_user</code>), so the lines having different logic depending on being logged in or not has been removed.</p> <p>Also, the email will be automatically sent by the Invitation model so calling <code>Mailer.deliver_invitation(@invitation, signup_url(@invitation.token))</code> is unnecessary (and actually it would have to be <code>AnalystInvitationMailer.deliver_invitation(@invitation)</code>)</p> <p>You can see a full working patch here: <a href="http://gist.github.com/290911" rel="nofollow noreferrer">http://gist.github.com/290911</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload