Guest User

Untitled

a guest
May 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def create
  2. @account = Account.new(params[:account])
  3. @account.parent_account_id = current_user.account_id if @account.id != current_user.account_id
  4.  
  5. respond_to do |format|
  6. if @account.save
  7. flash[:notice] = 'Account was successfully created.'
  8. format.html { redirect_to(accounts_path) }
  9. format.xml { render :xml => @account, :status => :created, :location => @account }
  10. else
  11. format.html { render :action => "new" }
  12. format.xml { render :xml => @account.errors, :status => :unprocessable_entity }
  13. end
  14. end
  15. end
Add Comment
Please, Sign In to add comment