def create
			account = if user_signed_in?
			Mtdevise::Account.create(account_params)
			else
				Mtdevise::Account.create_with_owner(account_params)
			end
		
			@account = account
			if account.valid?
				flash[:success] = "Your account has been successfully created."

			if user_signed_in?
				account.owner = current_user
				account.users << current_user
				account.save
				redirect_to mtdevise.accounts_path

			else
				sign_in account.owner
				redirect_to mtdevise.root_url(:subdomain => account.subdomain)
			end

			else
				flash[:error] = "Sorry, your account could not be created."
				render :new
			end

		end
def create
			account = if user_signed_in?
			Mtdevise::Account.create(account_params)
			else
				Mtdevise::Account.create_with_owner(account_params)
			end
		
			@account = account
			if account.valid?
				flash[:success] = "Your account has been successfully created."

			if user_signed_in?
				account.owner = current_user
				account.users << current_user
				account.save
				redirect_to mtdevise.accounts_path

			else
				sign_in account.owner
				redirect_to mtdevise.root_url(:subdomain => account.subdomain)
			end

			else
				flash[:error] = "Sorry, your account could not be created."
				render :new
			end

		end
Accounts Create action