aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
Commit message (Collapse)AuthorAgeFilesLines
* Include all helpers from non-namespaced enginesPiotr Sarnacki2010-09-031-9/+3
|
* Set only helpers_path on inherited hook in action_controller/railtie.rb and ↵Piotr Sarnacki2010-09-033-9/+11
| | | | use helper(:all) just after that
* Added more tests for polymorphic_url with namespaced models and implemented ↵Piotr Sarnacki2010-09-031-5/+10
| | | | missing use cases
* This was used only to clear warning in ActionMailer tests, it shouldn't be ↵Piotr Sarnacki2010-09-031-5/+0
| | | | done like that
* Moved ActionMailer and ActionController railties options to inherited hookPiotr Sarnacki2010-09-033-16/+32
| | | | | | | | | | | This change is needed, because we must take namespace into account and if controller's/mailer's class is namespaced, engine's paths should be set instead of application's ones. The nice side effect of this is removing unneeded logic in ActionController::Base.inherited - now the helpers_path should be set correctly even for engine's controllers, so helper(:all) will always include correct helpers.
* Modified polymorphic_url to check for model's namespacePiotr Sarnacki2010-09-031-0/+4
| | | | | | | | | | | This change allows using namespaced models with polymorphic_url, in the way that you would use them without namespace. Let's say that you have Blog::Post model in namespaced Engine. When you use polymorphic_path with Blog::Post instances, like in form_for(@post), it will look for blog_posts_path named url helper. As we are inside Blog::Engine, it's annoying to always use the prefix. With this commit, blog_ prefix will be removed and posts_path will be called.
* Refactor RoutesProxy to avoid using _with_routes in helpersPiotr Sarnacki2010-09-033-4/+10
|
* Refactor ActionMailer to not use hide_actionsPiotr Sarnacki2010-09-034-15/+36
|
* Move ActionController::Railties::RoutesHelpers and ↵Piotr Sarnacki2010-09-032-5/+6
| | | | ActionMailer::Railties::RoutesHelper to AbstractController::Railties::RoutesHelpers
* Fix generating urls with mounted helpers in view contextPiotr Sarnacki2010-09-033-3/+5
| | | | | | | | | | There were actually 2 problems with this one: * script_name was added to options as a string and then it was used in RouteSet#url_for with usage of <<, which was changing the original script_name * the second issue was with _with_routes method. It was called in RoutesProxy to modify _routes in view_context, but url_helpers in views is just delegating it to controller, so another _with_routes call is needed there
* Include application's helpers and router helpers by default, but include ↵Piotr Sarnacki2010-09-034-4/+30
| | | | engine's ones for controllers inside isolated namespace
* For view_context we need to initialize RoutesProxy in context of controller, ↵Piotr Sarnacki2010-09-031-2/+4
| | | | not view, quick fix, I need to dig into it later
* This is not neededPiotr Sarnacki2010-09-031-26/+0
|
* Modified ActionDispatch::Static to allow passing multiple rootsPiotr Sarnacki2010-09-031-10/+50
|
* Add Rails::Railtie.railtie_name method to allow setting custom name for railtiePiotr Sarnacki2010-09-031-2/+7
|
* We don't need delegating polymorphic_url and polymorphic_path anymorePiotr Sarnacki2010-09-031-10/+6
|
* Added ability to set asset_path for enginesPiotr Sarnacki2010-09-032-1/+4
|
* Add mounted_helpers to routesPiotr Sarnacki2010-09-036-24/+98
| | | | | | | | | | | | | | | | mounted_helpers are a bit similar to url_helpers. They're automatically included in controllers for Rails.application and each of mounted Engines. Mounted helper allows to call url_for and named helpers for given application. Given Blog::Engine mounted as blog_engine, there are 2 helpers defined: app and blog_engine. You can call routes for app and engine using those helpers: app.root_url app.url_for(:controller => "foo") blog_engine.posts_path blog_engine.url_for(@post)
* Routes refactoring:Piotr Sarnacki2010-09-033-9/+6
| | | | | | | * added more tests for prefix generation * fixed bug with generating host for both prefix and url * refactored url_for method * organized tests for prefix generation
* Ensure that env is always available in controllersPiotr Sarnacki2010-09-032-2/+6
|
* Extended url_for to handle specifying which router should be used.Piotr Sarnacki2010-09-033-29/+42
| | | | | | | A few examples: url_for Blog::Engine, :posts_path url_for Blog::Engine, @post url_for Blog::Engine, :action => "main", :controller => "index"
* Added some more tests for url generation between Engine and ApplicationPiotr Sarnacki2010-09-031-4/+4
|
* Get rid of :skip_prefix options in routesPiotr Sarnacki2010-09-032-14/+7
|
* New way of generating urls for Application from Engine.Piotr Sarnacki2010-09-033-9/+23
| | | | | | | | | It's based specifying application's script_name with: Rails.application.default_url_options = {:script_name => "/foo"} default_url_options method is delegated to routes. If router used to generate url differs from the router passed via env it always overwrites :script_name with this value.
* Allow to generate Application routes inside EnginePiotr Sarnacki2010-09-032-4/+4
| | | | | | This requires knowledge about original SCRIPT_NAME and the parent router. It should be pass through the env as ORIGIAL_SCRIPT_NAME and action_dispatch.parent_routes
* Use env['action_dispatch.routes'] to determine if we should generate prefix ↵Piotr Sarnacki2010-09-033-7/+48
| | | | | | | | | | or not. This technique is here to allow using routes from Engine in Application and vice versa. When using Engine routes inside Application it should generate prefix based on mount point. When using Engine routes inside Engine it should use env['SCRIPT_NAME']. In any other case it should generate prefix as env should not be even available.
* require 'active_support/dependencies' in action_dispatch/middleware/stackPiotr Sarnacki2010-09-031-0/+1
|
* Merge remote branch 'docrails/master'Xavier Noria2010-09-031-1/+1
|\
| * fix typo(?)Akira Matsuda2010-09-011-1/+1
| |
* | Revert "Setup explicit requires for files with exceptions. Removed them from ↵José Valim2010-09-0210-11/+15
| | | | | | | | | | | | | | | | autoloading." Booting a new Rails application does not work after this commit [#5359 state:open] This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
* | Ensure routes are loaded only after the initialization process finishes, ↵José Valim2010-09-021-5/+0
| | | | | | | | ensuring all configuration options were applied.
* | Setup explicit requires for files with exceptions. Removed them from ↵Łukasz Strzałkowski2010-09-0210-15/+11
| | | | | | | | | | | | autoloading. Signed-off-by: José Valim <jose.valim@gmail.com>
* | Cleaned up autoload definitions.Łukasz Strzałkowski2010-09-021-15/+20
| | | | | | | | | | | | Now it's more transparent, and readable Signed-off-by: José Valim <jose.valim@gmail.com>
* | Removing RJS hackThiago Pradi2010-09-022-6/+1
| | | | | | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* | Move implicit nested call before options handling so that nested constraints ↵Andrew White2010-09-011-9/+7
| | | | | | | | | | | | work [#5513 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Added :format option for form_for helper and spec for this [#5226 ↵Alex Chrome2010-09-011-1/+9
| | | | | | | | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Remove unnecessary code from UrlHelper#link_to.yury2010-09-011-7/+2
| | | | | | | | | | | | convert_options_to_data_attributes always returns not nil stringified html_options [#5445 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Use join instead of looping and calling to_s [#5492 state:resolved]Thiago Pradi2010-09-011-3/+1
|/ | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge remote branch 'docrails/master'Xavier Noria2010-09-011-2/+3
|\
| * Fix API docs for button_to optionsJaime Iniesta2010-08-311-2/+3
| |
* | Speed up form_for by specializing extract_options! (at asakusa.rb)wycats2010-08-311-6/+8
| |
* | Speed up content_tag_for by simplifying needed logicwycats2010-08-311-3/+3
|/
* resolves merge conflictXavier Noria2010-08-317-62/+263
|\
| * Expanded routing documentation with current best practicesJoost Baaij2010-08-295-21/+188
| |
| * Rework the routing documentation.Joost Baaij2010-08-281-22/+75
| | | | | | | | | | Move the default route to the bottom, as this practise should be discouraged. Add documentation for resources, external redirects and Rack applications.
| * The call-seq directive has no useful effect on our documentation and is not ↵Joost Baaij2010-08-281-19/+0
| | | | | | | | | | | | | | | | | | | | | | used anywhere else. Worse still, its use breaks some rdoc, replacing method names with a curly brace. Having just one call-seq directive doesn't add anything since this is covered by regular rdoc. Having multiple might make sense, but these are already documented with examples. This partly re-reverts 60de0e56b7f57f0052d7e4f43bd2ef9e363c6a1a but does not touch the vendorized code in html-scanner.
* | Remove NonConcattingString.José Valim2010-08-292-4/+1
| |
* | Remove deprecated support to <% form_for %> and several ↵José Valim2010-08-297-187/+12
| | | | | | | | ActionController::Base methods.
* | Ensure that inherited helper_methods are available after calling ↵Jesse Storimer2010-08-281-1/+11
| | | | | | | | | | | | clear_helpers [#5348 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Micro optimization for build_named_route_call in PolymorphicRoutes:yury2010-08-281-10/+10
| | | | | | | | | | | | | | | | | | 1. use map instead of inject 2. use [].join("_") instead of '<<'. It is a little bit faster for ruby 1.9.2 and x2 faster for ruby 1.8.7. http://gist.github.com/548143 [#5450 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>