4 ms·
Michael, thanks! Awesome work. If I might suggest one improvement: I'd change @title with content_for. A class attribute needlessly messes View and Controller.
by maurycy 17y ago
Michael, thanks! Awesome work.
If I might suggest one improvement: I'd change @title with content_for. A class attribute needlessly messes View and Controller.
- mhartl 17y agoThat's a good suggestion, and I'll definitely think about it. Early on in the tutorial I'd prefer to keep it as-is for simplicity and to help motivate instance variables. Also, it seems that setting instance variables in controllers for use in views is a common pattern. But switching to content_for at some point might make for a nice example of refactoring. (Good thing the book has tests for page titles. ;-) EDIT: Come to think of it, this might make for a good exercise.