Piotr Sarnacki
79bd92b783
Refactor ActionMailer to not use hide_actions
2010-09-03 22:59:11 +02:00
Piotr Sarnacki
4131a2d804
Move ActionController::Railties::RoutesHelpers and ActionMailer::Railties::RoutesHelper to AbstractController::Railties::RoutesHelpers
2010-09-03 22:59:11 +02:00
Piotr Sarnacki
befa77fc18
Fix generating urls with mounted helpers in view context
...
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
2010-09-03 22:59:10 +02:00
Piotr Sarnacki
c7664d112f
Include application's helpers and router helpers by default, but include engine's ones for controllers inside isolated namespace
2010-09-03 22:59:10 +02:00
Piotr Sarnacki
9913193931
For view_context we need to initialize RoutesProxy in context of controller, not view, quick fix, I need to dig into it later
2010-09-03 22:59:10 +02:00
Piotr Sarnacki
2734d3819f
This is not needed
2010-09-03 22:59:10 +02:00
Piotr Sarnacki
401cd97923
Modified ActionDispatch::Static to allow passing multiple roots
2010-09-03 22:59:09 +02:00
Piotr Sarnacki
bfccbc6df9
Add Rails::Railtie.railtie_name method to allow setting custom name for railtie
2010-09-03 22:59:08 +02:00
Piotr Sarnacki
0c1cd15470
to_param shoul return a string
2010-09-03 22:59:08 +02:00
Piotr Sarnacki
4cd6f77526
We don't need delegating polymorphic_url and polymorphic_path anymore
2010-09-03 22:59:08 +02:00
Piotr Sarnacki
a132229d7b
Added ability to set asset_path for engines
2010-09-03 22:59:08 +02:00
Piotr Sarnacki
1e6612ef80
Ensure that url_helpers included after application's ones have higher priority
2010-09-03 22:59:07 +02:00
Piotr Sarnacki
6c95e0f879
Add mounted_helpers to routes
...
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)
2010-09-03 22:59:07 +02:00
Piotr Sarnacki
e9791bec82
Routes refactoring:
...
* 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
2010-09-03 22:59:07 +02:00
Piotr Sarnacki
229a868264
Use new url_for API instead of including routes.url_helpers
2010-09-03 22:59:06 +02:00
Piotr Sarnacki
233be6572c
Ensure that env is always available in controllers
2010-09-03 22:59:06 +02:00
Piotr Sarnacki
b53efd2105
Extended url_for to handle specifying which router should be used.
...
A few examples:
url_for Blog::Engine, :posts_path
url_for Blog::Engine, @post
url_for Blog::Engine, :action => "main", :controller => "index"
2010-09-03 22:59:06 +02:00
Piotr Sarnacki
b697ba9fd7
Added some more tests for url generation between Engine and Application
2010-09-03 22:59:06 +02:00
Piotr Sarnacki
8a077089d9
Get rid of :skip_prefix options in routes
2010-09-03 22:59:06 +02:00
Piotr Sarnacki
b1e5e233fa
Refactored tests for prefix generation and added test for url generation in regular class with default_url_options[:script_name] set
2010-09-03 22:59:05 +02:00
Piotr Sarnacki
eedbf87d15
New way of generating urls for Application from Engine.
...
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.
2010-09-03 22:59:05 +02:00
Piotr Sarnacki
451c9942bb
Allow to generate Application routes inside Engine
...
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
2010-09-03 22:59:05 +02:00
Piotr Sarnacki
28016d33b0
Use env['action_dispatch.routes'] to determine if we should generate prefix 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.
2010-09-03 22:59:05 +02:00
Piotr Sarnacki
f7af75976a
require 'active_support/dependencies' in action_dispatch/middleware/stack
2010-09-03 22:59:03 +02:00
Xavier Noria
93acbf6bf3
Merge remote branch 'docrails/master'
2010-09-03 21:30:22 +02:00
José Valim
599e46bf24
Revert "Setup explicit requires for files with exceptions. Removed them from autoloading."
...
Booting a new Rails application does not work after this commit [#5359 state:open]
This reverts commit 38a421b34d .
2010-09-02 21:11:03 +02:00
José Valim
48bf667a8b
Ensure routes are loaded only after the initialization process finishes, ensuring all configuration options were applied.
2010-09-02 12:54:21 +02:00
Łukasz Strzałkowski
38a421b34d
Setup explicit requires for files with exceptions. Removed them from autoloading.
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-02 11:54:04 +02:00
Łukasz Strzałkowski
c5c839f75f
Cleaned up autoload definitions.
...
Now it's more transparent, and readable
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-02 11:53:58 +02:00
Thiago Pradi
df7f441c6e
Removing RJS hack
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-02 11:51:07 +02:00
Thiago Pradi
7698596adb
Removing unnecessary code from render_test
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-02 11:51:01 +02:00
Thiago Pradi
08187efa5b
Removing unnecessary code
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-02 11:50:51 +02:00
Andrew White
02480a897b
Move implicit nested call before options handling so that nested constraints work [ #5513 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-01 10:09:14 +02:00
Alex Chrome
dbf82557e4
Added :format option for form_for helper and spec for this [ #5226 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-01 09:59:54 +02:00
yury
9a6e3ae763
Remove unnecessary code from UrlHelper#link_to.
...
convert_options_to_data_attributes always returns not nil stringified html_options [#5445 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-01 09:57:04 +02:00
Thiago Pradi
46c14a6b03
Use join instead of looping and calling to_s [ #5492 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-01 09:46:30 +02:00
Akira Matsuda
37e0c153de
fix typo(?)
2010-09-01 16:00:55 +09:00
Andrew White
6c3f5eb76c
Bump rack-mount to 0.6.13 and add test case for named character classes [ #5509 state:resolved]
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-08-31 21:16:21 -03:00
Xavier Noria
8b2e4fddbf
Merge remote branch 'docrails/master'
2010-09-01 00:01:26 +02:00
wycats
58d3b90423
Speed up form_for by specializing extract_options! (at asakusa.rb)
2010-08-31 20:33:28 +09:00
wycats
c05f24c824
Speed up content_tag_for by simplifying needed logic
2010-08-31 19:52:26 +09:00
Jaime Iniesta
c2ed4a9f88
Fix API docs for button_to options
2010-08-31 09:19:43 +02:00
Xavier Noria
3805d01c9b
resolves merge conflict
2010-08-31 00:24:05 +02:00
José Valim
d37a65307d
Merge josevalim/deprecations branch.
...
I maintained on purpose the DeprecatedUrlOptions in ActionMailer and the Deprecated configuration in Railties because they were already addressed by Piotr in his RSoC work.
2010-08-30 15:55:10 -03:00
Jeremy Kemper
b861942691
Update CHANGELOGs for 3.0 release and upcoming 3.1
2010-08-29 22:06:48 -07:00
José Valim
3c8e1f99b9
Remove NonConcattingString.
2010-08-29 21:15:00 -03:00
José Valim
ba52748d05
Remove deprecated support to <% form_for %> and several ActionController::Base methods.
2010-08-29 21:08:14 -03:00
Jeremy Kemper
0d0c46abd1
Clean up CHANGELOGs
2010-08-28 15:45:14 -07:00
Joost Baaij
591e87fe7b
Expanded routing documentation with current best practices
2010-08-29 00:04:14 +02:00
Joost Baaij
5ead15b075
Rework the routing documentation.
...
Move the default route to the bottom, as this practise should be discouraged.
Add documentation for resources, external redirects and Rack applications.
2010-08-28 23:24:02 +02:00