diff options
author | Frederick Cheung <frederick.cheung@gmail.com> | 2009-01-01 16:58:55 +0000 |
---|---|---|
committer | Frederick Cheung <frederick.cheung@gmail.com> | 2009-01-01 16:58:55 +0000 |
commit | f7f1bb708870ac292029684002026387c54ab02e (patch) | |
tree | 8ea844a66f680b831fe9426df964ae5e19afcc39 /railties/doc/guides/source | |
parent | 2e1cd2e1fdeb13367d29847252c9400ceae7ca90 (diff) | |
download | rails-f7f1bb708870ac292029684002026387c54ab02e.tar.gz rails-f7f1bb708870ac292029684002026387c54ab02e.tar.bz2 rails-f7f1bb708870ac292029684002026387c54ab02e.zip |
info on namespaces
Diffstat (limited to 'railties/doc/guides/source')
-rw-r--r-- | railties/doc/guides/source/form_helpers.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/doc/guides/source/form_helpers.txt b/railties/doc/guides/source/form_helpers.txt index 9e27385af3..9ed196778d 100644 --- a/railties/doc/guides/source/form_helpers.txt +++ b/railties/doc/guides/source/form_helpers.txt @@ -312,6 +312,20 @@ Rails will also automatically set the class and id of the form appropriately: a WARNING: When you're using STI (single-table inheritance) with your models, you can't rely on record identification on a subclass if only their parent class is declared a resource. You will have to specify the model name, `:url` and `:method` explicitly. +Dealing with namespaces +^^^^^^^^^^^^^^^^^^^^^^^ + +If you have created namespaced routes `form_for` has a nifty shorthand for that too. If your application has an admin namespace then +------- +form_for [:admin, @article] +------- +will create a form that submits to the articles controller inside the admin namespace (submitting to `admin_article_path(@article)` in the case of an update). If you have several levels of namespacing then the syntax is similar: + +------- +form_for [:admin, :management, @article] +------- +For more information on Rails' routing system and the associated conventions, please see the link:../routing_outside_in.html[routing guide]. + Making select boxes with ease ----------------------------- |