How to specify a controller method will ONLY return jSON?
I have a controller method that will return just JSON. It will never be rendered in HTML ever. I know I can call controllerMethod.json?params=BLAHBLAH and it will return JSON for me, but if someone calls controllerMethod?params=BLAH I always want to return JS开发者_如何转开发ON as well... How do I do this?
just do only:
respond_to :json
精彩评论