add expiry parameter

This commit is contained in:
Albert Yi
2018-05-22 14:57:46 -07:00
parent 72d72fd3d0
commit da34c95da5
5 changed files with 12 additions and 9 deletions

View File

@@ -28,8 +28,8 @@ class UsersController < ApplicationController
render :xml => @users.to_xml(:root => "users")
end
format.json do
render json: @user.to_json
expires_in 7.days
render json: @users.to_json
expires_in params[:expiry].to_i.days if params[:expiry]
end
end
end