Skip to content

Commit ef1e216

Browse files
committed
Fix error with :Rcontroller without arguments
1 parent 506600d commit ef1e216

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/rails.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,9 +2208,11 @@ endfunction
22082208

22092209
function! s:controllerEdit(bang,cmd,...)
22102210
let suffix = '.rb'
2211-
if a:0 == 0 && RailsFileType() =~ '^view\%(-layout\|-partial\)\@!'
2211+
if a:0 == 0
22122212
let controller = s:controller(1)
2213-
let suffix = suffix.'#'.expand('%:t:r')
2213+
if RailsFileType() =~ '^view\%(-layout\|-partial\)\@!'
2214+
let suffix = suffix.'#'.expand('%:t:r')
2215+
endif
22142216
else
22152217
let controller = a:1
22162218
endif

0 commit comments

Comments
 (0)