Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to use single quotes for partials #462

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion autoload/rails.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3443,7 +3443,11 @@ function! s:Extract(bang,...) range abort
let erub2 = ''
endif
let spaces = matchstr(getline(first),"^ *")
let renderstr = 'render "'.fnamemodify(file,":r:r").'"'
if exists('g:rails_single_quotes_style')
let renderstr = "render '".fnamemodify(file,":r:r")."'"
else
let renderstr = 'render "'.fnamemodify(file,":r:r").'"'
endif
if ext =~? '^\%(rhtml\|erb\|dryml\)$'
let renderstr = "<%= ".renderstr." %>"
elseif ext == "rxml" || ext == "builder"
Expand Down
4 changes: 4 additions & 0 deletions doc/rails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,10 @@ single project.
Gem maintainers may also provide custom projections by placing them in
lib/rails/projections.json.

*g:rails_single_quotes_style*
Uses single quotes instead of double quotes when generating partials. See
|rails-partials|.

ABOUT *rails-about* *rails-plugin-author*

The latest stable version can be found at
Expand Down