diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-08-03 23:52:58 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:11 +0200 |
commit | 1a161c75eda50d58fe2a9c5bf3aee947ed17f5ea (patch) | |
tree | 38385c2ef64e9ffbd045062a6c968f62ef7d3af8 | |
parent | 2e4e1e7d0ce9bd0e9ea116a05a4ffcd989541cbd (diff) | |
download | rails-1a161c75eda50d58fe2a9c5bf3aee947ed17f5ea.tar.gz rails-1a161c75eda50d58fe2a9c5bf3aee947ed17f5ea.tar.bz2 rails-1a161c75eda50d58fe2a9c5bf3aee947ed17f5ea.zip |
Document engine_name
-rw-r--r-- | railties/lib/rails/engine.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index bf0d476e48..5b324663be 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -162,6 +162,22 @@ module Rails # With such config, asset paths will be automatically modified inside Engine: # image_path("foo.jpg") #=> "/my_engine/images/foo.jpg" # + # == Engine name + # + # There are some places where engine's name is used. + # * routes: when you mount engine with mount(MyEngine::Engine => '/my_engine'), it's used as default :as option + # * migrations: when you copy engine's migrations, they will be decorated with suffix based on engine_name, for example: + # 2010010203121314_create_users.my_engine.rb + # + # Engine name is set by default based on class name. For MyEngine::Engine it will be my_engine_engine. + # You can change it manually it manually using engine_name method: + # + # module MyEngine + # class Engine < Rails::Engine + # engine_name "my_engine" + # end + # end + # # == Namespaced Engine # # Normally, when you create controllers, helpers and models inside engine, they are treated |