From 1a161c75eda50d58fe2a9c5bf3aee947ed17f5ea Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 3 Aug 2010 23:52:58 +0200 Subject: Document engine_name --- railties/lib/rails/engine.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- cgit v1.2.3