Guest User

Untitled

a guest
Jun 24th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. ## error
  2. You have a nil object when you didn't expect it!
  3. The error occurred while evaluating nil.name
  4.  
  5. ## view
  6. <h1><%= @store.name %></h1>
  7.  
  8. ## edit action
  9. def edit
  10. @store = Store.find(params[:store_id])
  11. @store_daily_financial = StoreDailyFinancial.find(params[:id])
  12. end
  13.  
  14. ## update action
  15. def update
  16. @store_daily_financial = StoreDailyFinancial.find(params[:id])
  17. respond_to do |format|
  18. flash[:notice] = 'Updated'
  19. format.html { redirect_to(:controller => "home", :action => "admin") }
  20. else
  21. format.html {render :action => "edit"}
  22. end
  23. end
  24. end
Add Comment
Please, Sign In to add comment