I currently have a project for data storage records.
There is a nested resource, disks -> works.
I can then filter works index based the presence of params[:disk_id].
The h1 to the page is always “Works”.
I want it to change to “Works in Disk x”, if there is a params[:disk_id] present.
Haven’t managed to get a simple DRY way to manage this. Any tips?
You can use content_for construction in your layout to fill the title based on content (HAML syntax in example):
And in your views you can define
content_for :titleas you wish: