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.

Absolute file-path in windows get leading './'

#3546

When using an absolute file path like
'D:/path/to/project/vendor/plugin/views/view.rhtml' with render :file,
rails will look for
'./D:/path/to/p....' and crashs with Invalid Argument Error because of the './' at the beginning of the string.

I tracked it down to 'find_template' in actionpack/lib/action_view/paths.rb.
In line 64 the load path for the template is determined with '.', because it doesn't start with '/'.

And in actionpack/lib/action_view/template.rb in line 112, the File.join will add a '/' (even if paths.rb is altered, so that it doesn't add the dot).

Reported by Martin · December 7th, 2009 @ 04:22 PM

State: resolved
Milestone: none
Assigned to: Ryan Bigg Ryan Bigg
Importance: Low

Activity

  1. Martin
    Martin

    Sorry, but I was mistaken here.
    The problem occured in 2.3.2, in 2.3.5 it doesn't exist.

    This ticket can be closed.

    December 8th, 2009 @ 08:03 AM

  2. David Trasbo
    David Trasbo
    • Assigned user set to Ryan Bigg

    April 11th, 2010 @ 06:43 PM

  3. Ryan Bigg
    Ryan Bigg
    • State changed from new to resolved

    April 11th, 2010 @ 09:35 PM