Is it possible to configure Rails so that after running rails g migration name_of_migration
, it automatically opens that file in TextMate?
Asked
Active
Viewed 592 times
6
-
yeap, you can hack the source %) – vorobey Dec 16 '10 at 16:24
-
If my solution is the right one, would you mind selecting it? – adantj May 14 '19 at 16:44
2 Answers
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

adantj
- 446
- 4
- 13
-
1I'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"'` – MaicolBen Feb 10 '16 at 16:05
2
No, but you can generate migration in Textmate, using the following shortcut -
"Shift + Control + M"

Rishav Rastogi
- 15,484
- 3
- 42
- 47