Actions
Bug #1774
closedshow features that the smart proxy has in json output
Description
I want to see what features the smart proxy has in the json output like the following:
[{"smart_proxy":{"url":"http://172.16.220.140:8443","features":[{"feature_id":5,"name":"Puppet","smart_proxy_id":1},{"feature_id":4,"name":"Puppet CA","smart_proxy_id":1},{"feature_id":1,"name":"TFTP","smart_proxy_id":1}],"name":"test","id":1}}]
Below is the follow code need to make this happen:
format.json {render :json => SmartProxy.all.to_json(:except => [:created_at, :updated_at],:include => {:features => {:only => [:name,:feature_id, :smart_proxy_id]}})}
Actions