Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create
- @account = Account.new(params[:account])
- @account.parent_account_id = current_user.account_id if @account.id != current_user.account_id
- respond_to do |format|
- if @account.save
- flash[:notice] = 'Account was successfully created.'
- format.html { redirect_to(accounts_path) }
- format.xml { render :xml => @account, :status => :created, :location => @account }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @account.errors, :status => :unprocessable_entity }
- end
- end
- end
Add Comment
Please, Sign In to add comment