TextMeta有強大的程式碼片段功能,這裡提供一個templates包下載:
無法上傳.gz格式的附件,抱歉了,去下面連線找吧
1。把templates包解壓縮(最好放到Aptana安裝目錄下),有兩個xml檔案:ruby-rr-templates.xml和rhtml-rr-templates.xml
2。安裝:
1. Open RadRails
2. Go to Windows > Preferences > Ruby > Editor > Templates, to see the list of included templates
3. Click on any template, and press Ctrl-A to select them all.
4. Click on Remove, to delete them all
5. Click Import…, select the file ruby-rr-templates.xml
6. Change to Rails > Editiors > RHTML Editor > RHTML Templates
7. Remove all the current templates
8. Click Import…, select the file rhtml-rr-templates.xml
9. Press Ok to close the dialog and you’re done
然後測試:
開啟一個rb檔案,輸入:
bt ,然後按Ctrl + Space(你也可以自己去首選項裡修改Ruby content Assist的快捷鍵,改成Tab鍵更爽),就會變成belongs_to :object
開啟一個rhtml檔案:
按tab鍵(也可以設定其他鍵),輸入forin,你就可以選擇了,自己去試吧