Browse files

Use `File.expand_path` instead of `File.join`

  • Loading branch information...
1 parent 0c692f4 commit e073b038b7eb27f3dd18aa1edbd5a0b7e76b6476 @schneems schneems committed Dec 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/info_controller.rb
2 railties/lib/rails/info_controller.rb
@@ -1,7 +1,7 @@
require 'action_dispatch/routing/inspector'
class Rails::InfoController < ActionController::Base
- self.view_paths = File.join(File.dirname(__FILE__), 'templates')
+ self.view_paths = File.expand_path('../templates', __FILE__)
layout 'application'
before_filter :require_local!

3 comments on commit e073b03

Ruby on Rails member



@carlosantoniodasilva I'm curious, why was this change made? Is it preferable to use File.expand_path instead of File.join if the first param is File.dirname(__FILE__)? If so, there are a lot of other places where this change is needed, I could write the PR for that.

Ruby on Rails member

@ptn It's just that it's shorter and reads better this way, and since the WelcomeController with a default root action for dev was added with that, it was asked to change this one as well. I think we can change as we go, not sure there's a need to change everywhere :). Thanks!

Please sign in to comment.