Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Grant,
  2.  
  3. Having an issue linking this all together... for this nested time update button..
  4.  
  5. I want the button to update the call_responding which is inherited through the CallsController, the nested resource that the form pulls
  6. from is Calls::Respondings..
  7.  
  8. in my CallsController show action I have this
  9.  
  10. def show
  11. @call = Call.find(params[:id])
  12. ## Responding Nested
  13. @respondings = @call.respondings
  14. ## Ping Nested
  15. @pings = @call.pings
  16. ## Agency Nested
  17. @agencies = @call.agencies
  18. ## Incidents Nested
  19. @incidents = @call.incidents
  20. ## Complainants Nested
  21. @complainants = @call.complainants
  22. end
  23.  
  24. My Custon Controller Action is as follows:
  25.  
  26. def unit_responding_update
  27. @responding = Responding.find(params[:id])
  28. @responding.responding_tme = DateTime.now
  29. @responding.responding = "true"
  30. @responding.on_scene = "false"
  31. @responding.clear = "false"
  32. end
  33.  
  34. My end goal is to have that button push the data to the table.. using a link similar to:
  35.  
  36. <%= link_to "Responding", unit_responding_update_call_responding_path, method: :patch %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement