1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use new url_for API instead of including routes.url_helpers

This commit is contained in:
Piotr Sarnacki 2010-07-14 10:20:30 +02:00
parent 233be6572c
commit 229a868264
2 changed files with 4 additions and 9 deletions

View file

@ -47,9 +47,8 @@ module TestGenerationPrefix
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 @@ module TestGenerationPrefix
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 file

@ -45,10 +45,8 @@ module ApplicationTests
@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 @@ module ApplicationTests
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