In InvitationsController, extract resource invitation into its own method

This is just a small change to make it possible for a subclass to override how the resource is created (e.g. by passing a block to `resource.invite!`) without needing to override the entire create method.