| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
done like that
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
ActionDispatch::Static in initializers
|
| |
| |
| |
| | |
on method_added hook
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
ActionMailer::Railties::RoutesHelper to AbstractController::Railties::RoutesHelpers
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| | |
engine's ones for controllers inside isolated namespace
|
| |
| |
| |
| | |
not view, quick fix, I need to dig into it later
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
application's db/migrate directory
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ActiveRecord::Migration#copy allows to copy migrations from one place
to another, changing migrations versions and adding scope to filename.
For example:
ActiveRecord::Migration.copy("db/migrate",
:blog_engine => "vendor/gems/blog/db/migrate")
will copy all migrations from vendor/gems/blog/db/migrate to db/migrate
with such format:
Versions of copied migrations will be reversioned to be appended after
migrations that already exists in db/migrate
|
| | |
|
| | |
|
| |
| |
| |
| | |
db/migrate paths
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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"
|
| | |
|
| | |
|
| |
| |
| |
| | |
regular class with default_url_options[:script_name] set
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I added integration tests for generating urls in Engine and application
and tweaked Engines to fully cooparate with new router's behavior:
* Rails.application now sets ORIGINAL_SCRIPT_NAME
* Rails.application also sets its routes as env['action_dispatch.parent_routes']
* Engine implements responds_to? class method to respond to all the
instance methods, like #routes
|
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
determine if it should generate prefix for mounted apps
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|