Reputation: 7451
How to fetch the controller name on model in Rails?
Upvotes: 1
Views: 1450
Reputation: 115362
Why do you want to do that? It completely violates the Model/View/Controller architecture because models should have no knowledge of controllers. Controllers know about models, not the other way around.
If you tell us the problem you're trying to solve then we might be able to suggest a better alternative. Is it this one? Skipping before Create on particular controller alone in rails
Upvotes: 3