egervari
egervari

Reputation: 22512

Is there a way in rails to intercept controller requests?

I don't think Rails calls it an interceptor, but I don't know what to search for.

In Java/Spring, you can create Interceptors that are called before and after any controller action in the MVC framework. This makes it easy to add data to the model for every request, so you don't have to keep adding it to each of your 50 controllers.

I have to take a wild guess and say Rails has something to do achieve the same effect... but I have no idea what it is called.

Care to share? :)

Upvotes: 4

Views: 3551

Answers (1)

thekindofme
thekindofme

Reputation: 3866

What you are looking for is called Filters.

Upvotes: 6

Related Questions