With Vim Rails, can you create a new migration file and open it in one go?

Using vim with the Rails plugin, can you create a migration file and then open the file in one go?

Is this possible with textmate?

+5
source share
2 answers

You can use rails.vim and then do something like:

:Rgenerate migraton add_foo_to_bar

The plugin will open the file generated by the migration, which is exactly what you want. I can not speak for textmate.

+8
source

Vim, , SO. , rails ( vim , ):

supermanpatches.rb railsapp/config/initializers, ( TextMate) - ( : Ruby?)

def latestmigration
  `mate #{Dir.glob(File.join(Rails.root, 'db', 'migrate', '*.rb')).max { |a,b| File.ctime(a) <=> File.ctime(b)} }`
end

& Dagger;: (FYI /, , rails)

0

All Articles