Skip to content

Commit d21d6b6

Browse files
committed
Replace broken view finding code with s:findview
1 parent fb58b83 commit d21d6b6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

autoload/rails.vim

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,14 +2029,7 @@ function! s:RailsIncludefind(str,...)
20292029
elseif line =~# '\<has_\(and_belongs_to_\)\=many\s*(\=\s*'
20302030
let str = 'app/models/'.rails#singularize(str).'.rb'
20312031
elseif line =~# '\<def\s\+' && expand("%:t") =~# '_controller\.rb'
2032-
let str = s:sub(s:sub(RailsFilePath(),'/controllers/','/views/'),'_controller\.rb$','/'.str)
2033-
" FIXME: support nested extensions
2034-
for t in split(s:view_types,',')
2035-
if filereadable(str.format.'.'.t)
2036-
let str .= '.'.t
2037-
break
2038-
endif
2039-
endfor
2032+
let str = s:findview(str)
20402033
elseif str =~# '_\%(path\|url\)$' || (line =~# ':as\s*=>\s*$' && RailsFileType() =~# '^config-routes\>')
20412034
if line !~# ':as\s*=>\s*$'
20422035
let str = s:sub(str,'_%(path|url)$','')

0 commit comments

Comments
 (0)