Sha256: 19c766430dcbb21a6cc926c4f00eeca8113363dda63438003e62c59b0b772fd5
Contents?: true
Size: 769 Bytes
Versions: 26
Compression:
Stored size: 769 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
26 entries across 26 versions & 1 rubygems