I've added a theming directory to my app as described here, using prepend_view_path
. It works as expected. I can now add a view structure in my app under app/themes/my_theme/views
Now, I want to be able to override erb
templates by dropping in a
.liquid
file, which will render right off the controller action.
For example, I want to override app/views/pages/home.html.erb
:
<h1><%= t 'it_works' %></h1>
...with app/themes/my_theme/views/pages/home.liquid
<h1>It works with {{ "liquid" }}</h1>
I don't want to have to specify an array of view paths (upkeep would be awful), but just add .liquid
as a layer to the templating engine. Maybe, however, have a blacklist of protected views that cannot be overridden (such as app/views/admin/*
)