Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e97b51f
commit 0ee9c3e
Showing
3 changed files
with
102 additions
and
12 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
" Synopsis: | ||
" Rename current controller along with corresponding files | ||
function! RenameController() | ||
try | ||
|
||
let newcontroller = common#get_input("Controller name: ", "ERROR:: Enter a controller name." ) | ||
catch | ||
echo v:exception | ||
return | ||
endtry | ||
|
||
" Rename Rails Controller | ||
|
||
" Rename controller filename | ||
let path = common#get_controller_path() | ||
let newcontrollerpath = path.common#controller(newcontroller) | ||
let oldcontrollerpath = path.common#controller(split(common#get_file_name(), ".rb")[0]) | ||
call common#move(oldcontrollerpath, newcontrollerpath) | ||
|
||
" Rename helper filename | ||
let path = common#get_helper_path() | ||
let newhelperpath = path.common#helper(newcontroller) | ||
let oldhelperpath = path.common#helper(split(common#get_file_name(), ".rb")[0]) | ||
call common#move(oldcontrollerpath, newcontrollerpath) | ||
" | ||
" Rename views folder | ||
" | ||
" Rename helper Classname | ||
" | ||
" Rename Controller Classname | ||
|
||
endfunction |
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