Sorry for such a silly question, but couldn't find it on the docs:
filename.slim
filename.html.slim
This seems like a really great language to work with. I've used HAML
before, so I think this will be a fairly nice transition.
Sorry for such a silly question, but couldn't find it on the docs:
filename.slim
filename.html.slim
This seems like a really great language to work with. I've used HAML
before, so I think this will be a fairly nice transition.
filename.html.slim
However, in the generic sense, it is
filename.response_type.rendering_engine
e.g.
index.xml.haml
index.rss.slim
.html.slim
would seem to be the convention used by the creator of slim. Though it seems to be a convention used across rails for view files, including .html.haml
and .html.erb
for example. The same convention is used for a lot of abstracted files like .css.scss
and .js.coffee
.
Better to use .html.slim
extension.
For example, if your layout template named just with .slim
it will append not only for html response, but for js response too.
In this case, every time then you make jxh-request, you must set layout false
for every js format response.
Rails 7 with turbo/hotwire has an issue [1] with files that have just .slim
, so I think it's better to stick with .html.slim