Question

I've written an application controller that handles 99% of what I need any controller to do. I've posted it here (pastebin). Like I said, feel free to be harsh.

-update: added comments :)

Thx,

-C

P.S. I would like to say that my intention here is to overwrite methods that need different functionality in sub-classed controllers, such as the _message methods and the after_ methods. The application controller will serve as a sort of abstract class. also, some of the before_filters are specific to plugins, such as tiny_mce and restful_authentication (which is awesome, imho.)

Was it helpful?

Solution

This is not an answer to your question, but if you want to go further in this direction, you may want to take a look at Hobo. Its Hobo::ModelController does a lot of what your ApplicationController does.

OTHER TIPS

Small thing, but I would make the object, model, and model_name methods private or protected. Other than that I didn't notice any mistakes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top