Skip to content

Instantly share code, notes, and snippets.

@griffinqiu griffinqiu/vim
Last active Mar 30, 2018

Embed
What would you like to do?
Search and replace to add `params` in controller tests when upgrading rails to 5.1 in Vim
/\v^(\s+)(get|post|put|patch|destroy) :(\w+), ([^params].+[^,])$
:%s//\1\2 :\3, params: { \4 }/g
:%s/\v^(\s+)(get|post|put|patch|destroy) :(\w+), ([^params].+[^,])$/\1\2 :\3, params: { \4 }/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.