Guest User

Untitled

a guest
Feb 20th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def project(oid=nil, del=nil, add=nil)
  2. if !oid
  3. @items = Project.find
  4.  
  5. elsif oid == 'new'
  6. @obj = Project.new
  7. @obj.customer_oid = del unless del.nil?
  8.  
  9. elsif oid && del && !request.post?
  10. Project[oid.to_i].delete
  11. redirect_to_referer
  12.  
  13. elsif oid
  14. @obj = Project[oid.to_i]
  15. end
  16.  
  17. if request.post?
  18. @obj.assign(request).save
  19. redirect '/ctrl/project_details/'+@obj.oid.to_s
  20. end
  21. end
Add Comment
Please, Sign In to add comment