diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-09-20 21:27:43 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-20 23:55:27 +0200 |
commit | 07411ca4907ec32d9c23619390cf50c7c0c1af07 (patch) | |
tree | 68bd2a900285f2d9f83545f86c4b37c571730383 /railties | |
parent | 83ecd03e7d3472c16decbf1b9939da53347b36a3 (diff) | |
download | rails-07411ca4907ec32d9c23619390cf50c7c0c1af07.tar.gz rails-07411ca4907ec32d9c23619390cf50c7c0c1af07.tar.bz2 rails-07411ca4907ec32d9c23619390cf50c7c0c1af07.zip |
List all of isolated engine changes
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/engine.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index fd91185a47..0620b8608e 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -211,12 +211,30 @@ module Rails # end # end # - # If engine is marked as namespaced, FooController has access only to helpers from engine and + # If engine is marked as isolated, FooController has access only to helpers from engine and # url_helpers from MyEngine::Engine.routes. # + # The next thing that changes in isolated engine is routes behaviour. Normally, when you namespace + # your controllers, you need to use scope or namespace method in routes. With isolated engine, + # the namespace is applied by default, so you can ignore it in routes. Further more, you don't need + # to use longer url helpers like "my_engine_articles_path". As the prefix is not set you can just use + # articles_path as you would normally do. + # + # To make that behaviour consistent with other parts of framework, isolated engine has influence also on + # ActiveModel::Naming. When you use namespaced model, like MyEngine::Article, it will normally + # use the prefix "my_engine". In isolated engine, the prefix will be ommited in most of the places, + # like url helpers or form fields. + # + # polymorphic_url(MyEngine::Article.new) #=> "articles_path" + # + # form_for(MyEngine::Article.new) do + # text_field :title #=> <input type="text" name="article[title]" id="article_title" /> + # end + # + # # Additionaly namespaced engine will set its name according to namespace, so in that case: - # MyEngine::Engine.engine_name #=> "my_engine" - # and it will set MyEngine.table_name_prefix to "my_engine_" + # MyEngine::Engine.engine_name #=> "my_engine" and it will set MyEngine.table_name_prefix + # to "my_engine_". # # == Using Engine's routes outside Engine # |