recent_viewed_controller.rb 433 B

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