Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use new url_for API instead of including routes.url_helpers

  • Loading branch information...
commit 229a868264a1dd5f4441f4b82ccf2a51cf83511d 1 parent 233be65
@drogus drogus authored
View
5 actionpack/test/dispatch/prefix_generation_test.rb
@@ -47,9 +47,8 @@ def self.call(env)
end
class ::InsideEngineGeneratingController < ActionController::Base
- include BlogEngine.routes.url_helpers
def index
- render :text => post_path(:id => params[:id])
+ render :text => url_for(BlogEngine, :post_path, :id => params[:id])
end
def url_to_application
@@ -64,7 +63,7 @@ def url_to_application
class ::OutsideEngineGeneratingController < ActionController::Base
include BlogEngine.routes.url_helpers
def index
- render :text => post_path(:id => 1)
+ render :text => url_for(BlogEngine, :post_path, :id => 1)
end
end
View
8 railties/test/railties/mounted_engine_routes_test.rb
@@ -45,10 +45,8 @@ class Engine < ::Rails::Engine
@plugin.write "app/controllers/posts_controller.rb", <<-RUBY
class PostsController < ActionController::Base
- include Blog::Engine.routes.url_helpers
-
def index
- render :text => post_path(1)
+ render :text => url_for(Blog::Engine, :post_path, 1)
end
def generate_application_route
@@ -63,10 +61,8 @@ def generate_application_route
app_file "app/controllers/application_generating_controller.rb", <<-RUBY
class ApplicationGeneratingController < ActionController::Base
- include Blog::Engine.routes.url_helpers
-
def engine_route
- render :text => posts_path
+ render :text => url_for(Blog::Engine, :posts_path)
end
def url_for_engine_route
Please sign in to comment.
Something went wrong with that request. Please try again.