现在的位置: 首页 > 综合 > 正文

让RadRails可以提示语法

2013年03月18日 ⁄ 综合 ⁄ 共 783字 ⁄ 字号 评论关闭
TextMeta有强大的代码片段功能,这里提供一个templates包下载:templates包(要注册一下)

1。把templates包解压缩(最好放到RadRails安装目录下),有两个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,你就可以选择了,自己去试吧
  转自:http://ruby-lang.org.cn/forums/viewthread.php?tid=716&extra=page%3D1

抱歉!评论已关闭.