Guest User

Untitled

a guest
Jun 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. class SafeBalancesController < ApplicationController
  2.  
  3. def index
  4. @additions = Addition.find(:all)
  5. @deposits = Deposit.find(:all)
  6. @pettycashes = Pettycash.find(:all)
  7. @registers = Register.find(:all)
  8. @safe_balances = SafeBalance.find(:all)
  9.  
  10. respond_to do |format|
  11. format.html # index.html.erb
  12. format.xml { render :xml => @safe_balances }
  13. end
  14. end
  15.  
  16. # GET /registers/1
  17. # GET /registers/1.xml
  18. def show
  19. @safe_balance = @business_day.safe_balance
  20.  
  21. respond_to do |format|
  22. format.html # show.html.erb
  23. format.xml { render :xml => @safe_balance }
  24. end
  25. end
  26.  
  27. def update
  28. @safe_balance = @business_day.safe_balance
  29. respond_to do |format|
  30. if @safe_balance.update_attributes(params[:safe_balance])
  31. flash[:notice] = 'Safe Balance was successfully updated.'
  32. format.html { redirect_to(safe_balances_path) }
  33. format.xml { head :ok }
  34. else
  35. format.html { render :action => "edit" }
  36. format.xml { render :xml => @safe_balance.errors, :status => :unprocessable_entity }
  37. end
  38. end
  39. end
  40.  
  41. end
Add Comment
Please, Sign In to add comment