Skip to content

Commit 4723e04

Browse files
Elle Meredithelle
authored andcommitted
Make layout_by_path private
This is a helper method that should not be accessed externally
1 parent 6cb0749 commit 4723e04

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

app/controllers/pages_controller.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ class PagesController < ApplicationController
22
append_view_path "pages"
33
layout :layout_by_path
44

5-
def layout_by_path
6-
if request.path == "/docs"
7-
"homepage"
8-
elsif request.path.starts_with? "/docs/apis/graphql"
9-
"graphql"
10-
else
11-
"application"
12-
end
13-
end
14-
155
def show
166
@page = Page.new(view_context, params[:path])
177

@@ -41,4 +31,13 @@ def is_landing_page?
4131
end
4232
helper_method :is_landing_page?
4333

34+
def layout_by_path
35+
if request.path == "/docs"
36+
"homepage"
37+
elsif request.path.starts_with? "/docs/apis/graphql"
38+
"graphql"
39+
else
40+
"application"
41+
end
42+
end
4443
end

0 commit comments

Comments
 (0)