tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

`:Extract [partial_name]` shows message `No such directory` with file `app/views/layouts/application.html.erb` #534

Closed naofumi-fujii closed 5 years ago

naofumi-fujii commented 5 years ago

Problem

:Extract [partial_name] shows message No such directory with file app/views/layouts/application.html.erb

Expected

Why

rails partials path has changed. app/views/shared not found for recent Rails versions.

Rails 3.1, Rails 4, Rails 5 and whatever comes next

app/views/application
The engine searches this path automatically if the view is not found in the controller path.

Rails 3 and prior

app/views/shared
The engine does NOT search this path automatically.

Info

tpope commented 5 years ago

Nothing changed about app/views/shared, it was just a convention that never took off. I'm fine with getting rid of it, but we should axe the whole if rails#buffer().name() =~# '^app/views/layouts/application\>' conditional.

naofumi-fujii commented 5 years ago

fixed and force-pushed! Could you take a look ? @tpope

naofumi-fujii commented 5 years ago

i changed my mind to use app/views/shared for my partials. I'm sorry for the mishap.