Skip to content

Commit 9913aff

Browse files
committed
Treat mailers like controllers for render gf
1 parent 6275645 commit 9913aff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

autoload/rails.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,9 @@ function! s:RailsFind()
19451945
if res != ""|return res|endif
19461946

19471947
let res = s:sub(s:findfromview('render','\1'),'^/','')
1948-
if !buffer.type_name('controller') | let res = s:sub(res,'[^/]+$','_&') | endif
1948+
if !buffer.type_name('controller', 'mailer')
1949+
let res = s:sub(res,'[^/]+$','_&')
1950+
endif
19491951
if res != ""|return res."\n".s:findview(res)|endif
19501952

19511953
let res = s:findamethod('redirect_to\s*(\=\s*\%\(:action\s\+=>\|\<action:\)\s*','\1')
@@ -1963,7 +1965,7 @@ function! s:RailsFind()
19631965
endif
19641966
if res != ""|return res|endif
19651967

1966-
if buffer.type_name('controller')
1968+
if buffer.type_name('controller', 'mailer')
19671969
let contr = s:controller()
19681970
let view = s:findit('\s*\<def\s\+\(\k\+\)\>(\=','/\1')
19691971
if view !=# ''

0 commit comments

Comments
 (0)