The NHaml way to prevent presentation concerns in controllers

Based on Ayende’s post about not putting presentation concerns in the controller, here is the NHaml way of setting the page title in the view.

ViewsShareApplication.haml:

^ var title = “Page”;
!!!
%html{xmlns=”http://www.w3.org/1999/xhtml”}
%head
%title = title
%body
_

ViewsHomeIndex.haml;

– title = “Home Page”;
%content
This is my Home Page

ViewsHomeAbout.haml;

– title = “About Page”;
%content
This is my About Page

Simple isnt it?