Skip to content
Jason Marmon edited this page Feb 9, 2016 · 6 revisions

Find here some common projection recipes for gems. For more information on how to use them, consult :help rails-projections.

Activeadmin

let g:rails_gem_projections = {
  \ "activeadmin": {
  \   "app/admin/*.rb": {
  \     "command": "admin",
  \     "affinity": "model",
  \     "alternate": "app/models/{}.rb",
  \     "template": "ActiveAdmin.register {} do\nend"}}
}

Fabrication

let g:rails_gem_projections = {
  \ "fabrication": {
  \   "spec/fabricators/*_fabricator.rb": {
  \     "command": "fabricator",
  \     "affinity": "model",
  \     "alternate": "app/models/{}.rb",
  \     "related": "db/schema.rb#{plural}",
  \     "test": "spec/models/{}_spec.rb",
  \     "template": "Fabricator :{} do\nend"}}
}
Clone this wiki locally