summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lbennett@gitlab.com>2019-05-16 10:05:33 +0000
committerLuke Bennett <lbennett@gitlab.com>2019-05-16 10:05:33 +0000
commit3e02d7a96c4ee482ba08d6e8c297278fdd5f9f00 (patch)
treef0aea6401155c82fd50921c4671f3f9f1a9e2efc
parent19e0a9a038efdf9a1f5634ae05ada863625f95dd (diff)
downloadgitlab-ce-docs-render_if_exists-relative-path.tar.gz
Explain `render_if_exists` relative pathdocs-render_if_exists-relative-path
-rw-r--r--doc/development/ee_features.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md
index 9853b38b8e9..b9bcad0d444 100644
--- a/doc/development/ee_features.md
+++ b/doc/development/ee_features.md
@@ -446,6 +446,18 @@ The disadvantage of this:
port `render_if_exists` to CE.
- If we have typos in the partial name, it would be silently ignored.
+The `render_if_exists` view path argument must be relative to `app/views/` and `ee/app/views`.
+Resolving an EE template path that is relative to the CE view path will not work.
+
+```haml
+- # app/views/projects/index.html.haml
+
+= render_if_exists 'button' # Will not render `ee/app/views/projects/_button` and quietly fail
+= render_if_exists 'projects/button' # Will render `ee/app/views/projects/_button`
+```
+
+Will not render `ee/app/views/projects/_button`. Use `render_if_exists`
+
#### Using `render_ce`
For `render` and `render_if_exists`, they search for the EE partial first,