Today I Learned

hashrocket A Hashrocket project

Excluding view templates for Spina resources

When creating a view_template in a Spina CMS Rails app there is an option of exclude_from that will take an array of strings. For any resources included in this array, that view template will not be available to pages of that resource.

Here is an example:

theme.view_templates = [
  {
    # The rest of your view template...
    exclude_from: ["main", "blog_resource"]
  }
]

Note: If you want to exclude templates from being used on main spina pages, you can just exclude from the implicit "main" resource.

See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.