aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/action_view_overview.md
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2015-04-12 14:25:14 -0700
committerZachary Scott <e@zzak.io>2015-04-12 14:25:14 -0700
commit66f3ec6746449b627c2d99bf9772ad093c7f671e (patch)
tree5acbffe2162e1c5f9aa369db9fc0bef8854851e8 /guides/source/action_view_overview.md
parent9cabd35d4300208e1e038ee5720cf6ab6fd2018a (diff)
parent69283303f3efe4e3c1f58afa8044f9572ee71f16 (diff)
downloadrails-66f3ec6746449b627c2d99bf9772ad093c7f671e.tar.gz
rails-66f3ec6746449b627c2d99bf9772ad093c7f671e.tar.bz2
rails-66f3ec6746449b627c2d99bf9772ad093c7f671e.zip
Merge branch 'view_paths' of https://github.com/nishantmodak/rails into nishantmodak-view_paths
Diffstat (limited to 'guides/source/action_view_overview.md')
-rw-r--r--guides/source/action_view_overview.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md
index abf6c0db11..6021387bdb 100644
--- a/guides/source/action_view_overview.md
+++ b/guides/source/action_view_overview.md
@@ -356,7 +356,23 @@ Supposing we use the same `_box` partial from above, this would produce the same
View Paths
----------
-TODO...
+In case, you want to modify the default view path of a controller, you could either prepend or append to the view path, based on the need of looking it up before or after.
+
+### Prepend view path
+
+Example: Change view paths for different sub-domains. Prepend to the view path by doing
+
+```prepend_view_path "app/views/#{request.subdomain}"```
+
+After this, views will be looked up in this order ```[~/rails_app/app/views/<subdomain>, ~/rails_app/app/views]```
+
+### Append view path
+
+Similarly, to append to the view paths you would do it with
+
+```append_view_path "app/views/direct"```.
+
+This would add ```app/views/direct``` and the end of lookup paths for views.
Overview of helpers provided by Action View
-------------------------------------------