app/controllers/account_controller.rb
def register_by_email_activation(user, _opts = {})
    token = Token::Invitation.new(user: user)

    if user.save and token.save
      send_activation_email! token
      flash[:notice] = I18n.t(:notice_account_register_done)

      redirect_to action: 'login'
    else
      yield if block_given?
    end
  end
# Register a user for email activation.
#
# Pass a block for behavior when a user fails to save
Register a user for email activation.
Pass a block for behavior when a user fails to save
Register a user for email activation . Pass a block for behavior when a user fails to save
def register_by_email_activation(user, _opts = {})
    token = Token::Invitation.new(user: user)
    if user.save and token.save
      send_activation_email! token
      flash[:notice] = I18n.t(:notice_account_register_done)
      redirect_to action: 'login'
    else
      yield if block_given?
    end
  end
def register_by_email_activation ( user , _opts = { } ) token = Token :: Invitation . new ( user : user ) if user . save and token . save send_activation_email! token flash [ :notice ] = I18n . t ( :notice_account_register_done ) redirect_to action : 'login' else yield if block_given? end end
Register a user for email activation.
Register a user for email activation .
user
_opts