Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Allow Rails.root to take arguments to build a path with File.join

#1482

Rails.root
=> RAILS_ROOT

Rails.root('public', 'images', 'rails.png')
=> File.join(Rails.root, 'public', 'images', 'rails.png')

Reported by Damian Janowski · November 26th, 2008 @ 02:29 PM

State: committed
Milestone: 2.x
Assigned to: DHH DHH
Importance: none

Activity

  1. Damian Janowski
  2. Damian Janowski
    Damian Janowski

    Updating patch to handle RAILS_ROOT = nil or ''.

    November 28th, 2008 @ 03:41 PM

  3. Repository
    Repository
    • State changed from new to committed

    (from [fdfcdf467387c4db3d79c1f46eadbb55a88ef814]) Enhanced Rails.root to take parameters that'll be join with the root, like Rails.root('app', 'controllers') => File.join(Rails.root, 'app', 'controllers') [#1482 Allow Rails.root to take arguments to build a path with File.join state:committed] (Damian Janowski) http://github.com/rails/rails/co...

    November 29th, 2008 @ 09:57 AM

  4. Damian Janowski
    Damian Janowski

    @DHH, I really think we should not call #compact on the array. Keeping File.join's API sounds better. (And I think there are potential security issues if we silently remove nils from args).

    November 29th, 2008 @ 11:54 PM

  5. DHH
    DHH

    Sounds better how? And what's the security issues you see?

    November 30th, 2008 @ 08:03 AM

  6. Repository
    Repository

    (from [be140e8c6be966349c6fa35a87f84d5a73995b9a]) Changed Rails.root to return a Pathname object (allows for Rails.root.join("app", "controllers") => "#{RAILS_ROOT}/app/controllers") [#1482 Allow Rails.root to take arguments to build a path with File.join] http://github.com/rails/rails/co...

    December 1st, 2008 @ 02:10 AM