开发者

Rails: Howto get the controller generator add format.json call to all action respond_to blocks?

开发者 https://www.devze.com 2022-12-08 04:17 出处:网络
Could someone please remind how I get the generator to add the lines required to use JSON in my controllers? Having to type format.json{ render :json => @story } type lines to each action is starting

Could someone please remind how I get the generator to add the lines required to use JSON in my controllers? Having to type format.json { render :json => @story } type lines to each action is starting to ge开发者_运维知识库t old?


You would need to patch rails generator templates to handle this. I know of no way to specify it

0

精彩评论

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