recent_viewed_controller.rb 516 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
  2. class RecentViewedController < ApplicationController
  3. before_filter :authentication_check
  4. =begin
  5. Resource:
  6. GET /api/v1/recent_viewed
  7. Response:
  8. {
  9. ...
  10. }
  11. Test:
  12. curl http://localhost/api/v1/recent_viewed.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X GET
  13. =end
  14. def recent_viewed
  15. recent_viewed = RecentView.list_fulldata( current_user, 10 )
  16. # return result
  17. render :json => recent_viewed
  18. end
  19. end