Created
October 13, 2016 12:27
-
-
Save itsterry/e8e7e3c950ff9b7da479016cd64918a8 to your computer and use it in GitHub Desktop.
Vim command to turn RSpec controller actions into new 'process' format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Only works with leading spaces (not tabs) and with existing params | |
# So get :edit, id: 1 # will work | |
# But get :edit # won't | |
%s/\(^ *\)\(get\|post\|patch\|delete\) \(:[^,]*\), \(.*$\)/\1process \3, via: :\2, params: { \4 }/ge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment