开发者

In the model, is there a way to get the results of a controller request?

In a model Feed. is there a way to get the results of a controller call.

   class Feed < ActiveRecord::Base
      output = Con开发者_StackOverflowtrollerName.Action(params)

Is something like that possible?


You can't (well if you really want to you can, but you shouldnt). Your controller should call a method from your model instead. Another alternative is to create a module and use it as a mixin in both classes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜