AnApprentice
AnApprentice

Reputation: 110960

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 = ControllerName.Action(params)

Is something like that possible?

Upvotes: 0

Views: 47

Answers (1)

Pablo Castellazzi
Pablo Castellazzi

Reputation: 4184

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.

Upvotes: 2

Related Questions