阅读背景:

我可以在Ruby on Rails中将api控制器用于其他控制器

来源:互联网 

I want to create a ruby on rails app, which provides an api and also a portal. Consider that we can create users and lets say todo entries via the api and the portal as well. To make it DRY I want to use the api methods, within the other controllers. So when the user creates a todo entry via the portal, the business logic of the corresponding api controller should be executed instead of copying the code from that controller to the todo controller. Also I do want a separate api controller, since other clients (like mobile phones) should call a certain endpoint (like %BASE_URI%/api/rest/v1/...) instead of the different controllers. Is that possible and are there any best practises?I want to create a ruby on rails app, which pro




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: