Skip to content
Commits on Jul 30, 2010
  1. Include application's helpers and router helpers by default, but incl…

    committed Jul 30, 2010
    …ude engine's ones for controllers inside isolated namespace
Commits on Jul 29, 2010
  1. This is not needed

    committed Jul 29, 2010
  2. rake db:copy_migrations task, which copies railties migrations into a…

    committed Jul 26, 2010
    …pplication's db/migrate directory
  3. Implemented ActiveRecord::Migrations#copy based on James Adam's idea

    committed Jul 26, 2010
    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
  4. to_param shoul return a string

    committed Jul 24, 2010
  5. Add mounted_helpers to routes

    committed Jul 18, 2010
    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)
  6. Routes refactoring:

    committed Jul 15, 2010
    * 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
  7. Extended url_for to handle specifying which router should be used.

    committed Jul 14, 2010
    A few examples:
    url_for Blog::Engine, :posts_path
    url_for Blog::Engine, @post
    url_for Blog::Engine, :action => "main", :controller => "index"
  8. Refactored tests for prefix generation and added test for url generat…

    committed Jul 8, 2010
    …ion in regular class with default_url_options[:script_name] set
  9. New way of generating urls for Application from Engine.

    committed Jul 8, 2010
    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.
  10. Fix url generation for mounted Engine

    committed Jul 7, 2010
    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
  11. Allow to generate Application routes inside Engine

    committed Jul 7, 2010
    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
  12. Pass routes via env['action_dispatch.routes'], it's needed by routes …

    committed Jul 1, 2010
    …to determine if it should generate prefix for mounted apps
  13. Use env['action_dispatch.routes'] to determine if we should generate …

    committed Jul 1, 2010
    …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.
  14. Move singleton pattern to Railtie and remove Engine::Configurable and…

    committed Jul 19, 2010
    … Application::Configurable in favor of unified Railtie::Configurable
Something went wrong with that request. Please try again.