Sha256: fa423133390bd3c873abbdf943b06ee7abd2c9d2053d7d0fc5f8b6229f21a8e8
Contents?: true
Size: 770 Bytes
Versions: 21
Compression:
Stored size: 770 Bytes
Contents
require_dependency "mtwarden/application_controller" module Mtwarden class AccountsController < ApplicationController def new @account = Mtwarden::Account.new @account.build_owner end def create @account = Mtwarden::Account.create_with_owner(account_params) if @account.valid? force_authentication!(@account.owner) flash[:success] = "Your account has been successfully created." redirect_to mtwarden.root_url(:subdomain => @account.subdomain) else flash[:error] = "Sorry, your account could not be created." render :new end end private def account_params params.require(:account).permit(:name, :subdomain, { :owner_attributes => [ [:email, :password, :password_confirmation] ]} ) end end end
Version data entries
21 entries across 21 versions & 1 rubygems