开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜