Permalink
Browse files

Fix gf on render :template/:action

Resolves #181.
  • Loading branch information...
tpope committed Sep 18, 2012
1 parent 9fb06f5 commit 2d6558125cce7fcf1740d58870bda04eb66d3851
Showing with 5 additions and 5 deletions.
  1. +5 −5 autoload/rails.vim
View
@@ -1943,19 +1943,19 @@ function! s:RailsFind()
if res != ""|return res|endif
let res = s:findasymbol('action','\1')
- if res != ""|return res|endif
+ if res != ""|return s:findview(res)|endif
- let res = s:findasymbol('template','app/views/\1')
- if res != ""|return res|endif
+ let res = s:findasymbol('template','\1')
+ if res != ""|return s:findview(res)|endif
let res = s:sub(s:sub(s:findasymbol('partial','\1'),'^/',''),'[^/]+$','_&')
if res != ""|return res."\n".s:findview(res)|endif
let res = s:sub(s:sub(s:findfromview('render\s*(\=\s*\%(:partial\s\+=>\|partial:\)\s*','\1'),'^/',''),'[^/]+$','_&')
if res != ""|return res."\n".s:findview(res)|endif
- let res = s:findamethod('render\>\s*\%(:\%(template\|action\)\s\+=>\|template:\|action:\)\s*','\1.'.format.'\n\1')
- if res != ""|return res|endif
+ let res = s:findamethod('render\>\s*\%(:\%(template\|action\)\s\+=>\|template:\|action:\)\s*','\1')
+ if res != ""|return s:findview(res)|endif
let res = s:sub(s:findfromview('render','\1'),'^/','')
if !buffer.type_name('controller', 'mailer')

0 comments on commit 2d65581

Please sign in to comment.