Senthil Kumar Bhaskaran
Senthil Kumar Bhaskaran

Reputation: 7451

Fetching Controller Name on Model in rails

How to fetch the controller name on model in Rails?

Upvotes: 1

Views: 1450

Answers (1)

John Topley
John Topley

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

Related Questions