Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Sometimes just DRY the controllers is not enough, if you need to DRY up your views, a lot of the resources often share the same views, wouldn't it be nice to have view files DRY'ed too? You can!
In Rails 3.1, this will be a Rails feature, but if you need to use a previous version, there are currently three projects do just that:
Inherited Resources Views
Inherited Resources Views is an extremely easy to use plugin to DRY the views associated with your inherited resources controllers. It is library-agnostic (it only depends on Inherited Resources) and it supports generating both erb and haml templates.
NOTE: This project is marked as abandoned on the GitHub page (http://stillmaintained.com/fredwu/inherited_resources_views)
Inherited Views is a thin addition to the Inherited Resources project adding default html views which can be later customized on a per controller basis or globally for your rails app. It depends on Inherited Resources, Formtastic and WillPaginate.
Render Inheritable allows one to generally inherit or override single templates for controller hierarchies. If a template is not found in the current view folder, it is looked up in the parent controller's view folder. There are no other dependencies except for Rails 3.