Ignore dots in slugs when rendering custom pages

We were getting a warning in one of the tests:

DEPRECATION WARNING: Rendering actions with '.' in the name is
deprecated: application/nonExistentJavaScript.js

I haven't found a case where the behavior on production environments is
different due to this change; the application seems to behave the same
way as it used to. So I'm not adding tests for this change.
This commit is contained in:
Javi Martín
2023-07-17 00:17:59 +02:00
parent 633ccf80f6
commit b2c8fee059

View File

@@ -11,7 +11,7 @@ class PagesController < ApplicationController
@cards = @custom_page.cards
render action: :custom_page
else
render action: params[:id]
render action: params[:id].split(".").first
end
rescue ActionView::MissingTemplate
head :not_found, content_type: "text/html"