Ruby on Rails 开发效率提升:Visual Studio Code 扩展插件
Ruby on Rails 开发者们,现在可以使用最新版的 Visual Studio Code 扩展插件来提升您的开发效率。该插件为您提供了丰富的代码片段,支持最新的 Rails 版本,并计划推出更多功能,满足您的开发需求。
即将推出的功能:
使用方法:
输入帮助器名称,并将 "_" 替换为 "-"。例如:
控制器:
例如:
类型 | 输出 |
---|---|
crud | 完整的 CRUD 帮助器 |
def-create | 创建资源的定义 |
find-id | find(id) |
find-params | find(params[:id]) |
模型:
after-create
after-save
after-update
after-destroy
after-validation
after-validation-on-create
after-validation-on-Update
before-action
before-create
before-save
before-validation
before-destroy
before-update
before-validation-on-create
before-validation-on-update
has-many
has-many-through
has-many-dependent
has-one
has-one-through
has-and-belongs-to-many
validate
validates
validates-acceptance-of
validates-acceptance-of-if
validates-associated
validates-associated-if
validates-confirmation-of
validates-confirmation-of-if
validates-exclusion-of
validates-exclusion-of-if
validates-format-of
validates-format-of-if
validates-inclusion-of
validates-inclusion-of-if
validates-length-of
validates-length-of-if
validates-length-of-is
validates-length-of-minimum
validated-numericality-if
validated-numericality-of
validated-presence-of
validated-presence-of-if
validated-uniqueness-of
validated-uniqueness-of-if
迁移:
类型 | 输出 |
---|---|
t.binary | Binary |
t.boolean | Boolean |
t.time | Time |
t.timestamp | Timestamp |
t.timestamps | Timestamps |
t.date | Date |
t.datetime | Datetime |
t.decimal | Decimal |
t.float | Float |
t.integer | Integer |
t.integer-lock | Integer Lock |
t.references | References |
t.rename | String |
t.text | Text |
t.rename | Rename |
t.column | Column |
t.columns | Columns |
add-column | Add Column |
remove-column | Remove column |
change-column | Change column |
rename-column | Change column |
add-index | Add index |
remove-index | Remove Index |
create-table | Create Table |
drop-table | Drop Table |
ERB 模板:
渲染:
Gem:
属性:
使用代码片段:
开始输入您想要的帮助器名称(例如:"emb" 代表 "embed"),然后按 Tab 键插入代码片段。
或者,按 Ctrl Space(Windows, Linux)或 Cmd Space(OSX)在编辑器中激活代码片段。
安装步骤:
本站所有资源都是由网友投稿发布,或转载各大下载站, 请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则 产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:study_golang@163.com