Let’s work an important feature of our web apps: Page titles. These provides a better experience for the visitor.
While developing a website we use to have our broswer full crowded of tabs. The only way to know in which tab is the page we are looking for is by means of Page Title.
1. Create a method that generates markup for the layout
2. Set a meaningful title using previously defined method. Neat detail is that we can use variables, so now our titles are dynamic!
3. Use title defined in the View. It’s a good practice to include a default value, “My Website” in the example code.
That’s all. The power to titles can be provided by variables defined and constructed in controllers. Use methods of your models to obtain great titles.