automatically open Rails generate migration file in editor
Asked Answered
Z

2

6

Is it possible to configure Rails so that after running rails g migration name_of_migration, it automatically opens that file in TextMate?

Zachery answered 15/12, 2010 at 22:21 Comment(2)
yeap, you can hack the source %)Dreddy
If my solution is the right one, would you mind selecting it?Ofilia
O
5

You could create an alias with this:

alias last_migration='ls db/migrate/* | tail -n1 | xargs open -a "Textmate"'

and then run it from your terminal:

last_migration
Ofilia answered 23/1, 2013 at 20:17 Comment(1)
I've to do add *.rb to the ls filter because it didn't worked for me: alias last_migration='ls db/migrate/*.rb | tail -n1 | xargs open -a "MyEditor"'Callan
L
2

No, but you can generate migration in Textmate, using the following shortcut -

"Shift + Control + M"

Lindly answered 16/12, 2010 at 22:3 Comment(2)
Doesn't work for me. Do I need a special bundle or something?Singlehandedly
you need the ruby on rails bundleLindly

© 2022 - 2024 — McMap. All rights reserved.