taking advantage of Rails polymorphism to clean up templates code