title: How to override devise registrations controller
body: <p>I am working on invitations per this <a href="http://railscasts.com/episodes/124-beta-invitations" rel="nofollow">railscast</a> and I am using devise for authentication in my app.  I would like to get this bit of code implemented:</p>
  
  <pre><code>def new
    @user = User.new(:invitation_token =&gt; params[:invitation_token])
    @user.email = @user.invitation.recipient_email if @user.invitation
  end
  </code></pre>
  
  <p>inside of devise.  This involves overriding the registrations controller.  Here is the new  action that is in the registrations controller:</p>
  
  <pre><code>  def new
      resource = build_resource({})
      respond_with resource
    end
  </code></pre>
  
  <p>I am relatively new to coding and made an attempt to sift through the devise code and figure out what's going on, but seems daunting.  Is there something simple to this?  How can I get that code implemented by overriding the devise registrations controller?</p>