| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
not DRY
|
| |
|
| |
|
|
|
|
| |
in :constraints in routes
|
| |
|
| |
|
| |
|
|
|
|
| |
entire routes object
|
| |
|
|
|
|
| |
polymorphic_url
|
|
|
|
| |
polymorphic_routes, for example: polymorphic_url([blog, @post])
|
| |
|
|
|
|
| |
missing use cases
|
|
|
|
| |
done like that
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
not view, quick fix, I need to dig into it later
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
A few examples:
url_for Blog::Engine, :posts_path
url_for Blog::Engine, @post
url_for Blog::Engine, :action => "main", :controller => "index"
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
autoloading."
Booting a new Rails application does not work after this commit [#5359 state:open]
This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
|
|
|
|
|
|
| |
autoloading.
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
work [#5513 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|\ |
|
| | |
|
|/
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Rails 2.3)
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
behavior in the router.
If you were using symbols before for methods like match/get/post/put/delete, it is likely that this commit will break your routes.
Everything should behave the same if you are using strings, if not, please open up a ticket.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
router. [#5431 state:resolved]
|
|
|
|
|
|
|
|
| |
name and action if the string is a valid ruby method name.
[#5431 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
request object rather than the environment hash. This it to prevent stale parameters in later routing constraints/redirects as only the normal path parameters are set by Rack::Mount.
Also if a constraint proc arity is more than one, pass the symbolized path parameters
as the first argument to match redirect proc args and provide easier access.
[#5157 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
|
|
|
|
|
|
| |
Extend assert_recognizes and assert_generates to support passing
full urls as the path argument. This allows testing of routing
constraints such as subdomain and host within functional tests.
[#5005 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
|
| |
ensure that request.scheme returns https when using a reverse proxy.
[#5408 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
into the scope [#5208 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|