Question

I looked at the documentation and couldn't find anything that suggested this is possible. Here's my use case: I'm making a game and I've got 3 html files that are 90% the same. One is used for the actual game, one is for manual testing, and one is used for automated tests. Every time I change one, I've got to copy the change to the other two files for consistency. I'm trying to remove this DRY violation. Does haml give me a way to avoid copying and pasting this content to each of these files?

Was it helpful?

Solution

I would recommend creating a partial file with all the common content shared between these 2 html files and then render the partial file using this notation

= render :partial => "common_content"

Check out more about partial files here http://haml.info/tutorial.html

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