aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authorSimon Jefford <simon.jefford@gmail.com>2009-03-06 14:44:46 +0000
committerSimon Jefford <simon.jefford@gmail.com>2009-03-06 14:44:46 +0000
commit3a5d922f67e3d3c0b9f1ee2c2293b70e4723d91c (patch)
tree7031968fa5638bc57ed50f565d76e59ba9074618 /railties/guides/source
parentcb40c761b2ac1c82e6fb0e777eb48426a9dfa055 (diff)
downloadrails-3a5d922f67e3d3c0b9f1ee2c2293b70e4723d91c.tar.gz
rails-3a5d922f67e3d3c0b9f1ee2c2293b70e4723d91c.tar.bz2
rails-3a5d922f67e3d3c0b9f1ee2c2293b70e4723d91c.zip
Updated the Rails on Rack section concerning metal
- Explained how to override the default load order of metal apps - Explained that metal apps within plugins will also be loaded
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/rails_on_rack.textile12
1 files changed, 11 insertions, 1 deletions
diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile
index e300e047b4..a187e90742 100644
--- a/railties/guides/source/rails_on_rack.textile
+++ b/railties/guides/source/rails_on_rack.textile
@@ -226,6 +226,8 @@ class Poller
end
</ruby>
+Metal applications within +app/metal+ folders in plugins will also be discovered and added to the list
+
Metal applications are an optimization. You should make sure to "understand the related performance implications":http://weblog.rubyonrails.org/2008/12/20/performance-of-rails-metal before using it.
h4. Execution Order
@@ -244,7 +246,15 @@ def call(env)
end
</ruby>
-In the code above, +@metals+ is an ordered ( alphabetical ) hash of metal applications. Due to the alphabetical ordering, +aaa.rb+ will come before +bbb.rb+ in the metal chain.
+In the code above, +@metals+ is an ordered hash of metal applications. Due to the default alphabetical ordering, +aaa.rb+ will come before +bbb.rb+ in the metal chain.
+
+It is, however, possible to override the default ordering in your environment. Simply add a line like the following to +config/environment.rb+
+
+<ruby>
+config.metals = ["Bbb", "Aaa"]
+</ruby>
+
+Each string in the array should be the name of your metal class. If you do this then be warned that any metal applications not listed will not be loaded.
WARNING: Metal applications cannot return the HTTP Status +404+ to a client, as it is used for continuing the Metal chain execution. Please use normal Rails controllers or a custom middleware if returning +404+ is a requirement.