It is minor mode for editing Ruby On Rails code with Emacs. This repo is a fork of remvee emacs-rails and adds the missing Rails 4 structure.
- Rails 4 ready
Implements new rails 4 directory structure: app/models, test/models etc. - Decorators
Include in Navigation and Running Tests - Navigation
Go from unit test to model to controller to functional test to view etc. - Running tests
Run test for the current model, controller, lib, decorator etc. - Console and webserver
Run this console and webserver in a buffer. - Rake tasks
Run rake tasks like rake db:migrate - Generations
Run rails generate scripts like rails generate model …
Try C-h b
to find out what key bindings are available and see M-x customize-group <RET> rails
for all the knobs and switches.
All below listed packages (except this minor-mode) can be installed via MELPA, ELPA or MARMELADE.
- Ruby Mode
- Inferior Ruby Mode
Pull the latest version from github:
git clone git://github.com/joe81/emacs-rails.git ~/.emacs.d/emacs-rails
Hook it up in your .emacs
or .emacs.d/init.el
with something like:
(add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-rails"))
(require 'rails)
You’re ready to go.
- rhtml-mode
- yaml-mode
- ruby-electric
- company-mode or auto-complete
- robe
- flymake-ruby, flymake-coffee, flymake-json, flymake-yaml
- autopair-mode
- yasnippet-mode
- coffee-mode
As default this mode can be used for Rails 4 projects. If you want to use it for Rails 3 projects, checkout the rails-3.x branch or use the original repo from remvee/emacs-rails.git
C-c C-c g m
goto modelsC-c C-c g c
goto controllersC-c C-c g d
goto decoratorsC-c C-c g d
goto libsC-c C-c g h
goto helpersC-c C-c g g
goto migrationsC-c C-c g j
goto javascriptsC-c C-c g s
goto stylesheetsC-c C-c g l
goto layoutsC-c C-c g p
goto pluginsC-c C-c g u
goto model testsC-c C-c g f
goto controller testsC-c C-c g i
goto integration testsC-c C-c g d
goto decorator testsC-c C-c g x
goto fixturesC-return
goto file on current line
Quick switch from Model to:
C-c c
ControllerC-c d
DecoratorC-c u
ModelTestC-c x
Fixture
Quick switch from Controller to:
C-c m
ModelC-c h
HelperC-c d
DecoratorC-c f
ControllerTestC-up
View of methodC-down
Select specific view
See context sensitive menus for other quick switchs.
C-c f m
find modelsC-c f c
find controllerC-c f h
find helpersC-c f l
find layoutC-c f s
find stylesheetsC-c f j
find javascriptsC-c f g
find migrateC-c f b
find libC-c f t
find tasksC-c f v
find viewC-c f d
find dbC-c f p
find publicC-c f f
find fixturesC-c f o
find configC-c f a
find assets
C-c C-c y a
Start all testsC-c C-c y u
Start all model testsC-c C-c y f
Start all controller testsC-c C-c y d
Start all decorator testsC-c C-c y i
Start all integration testsC-c C-c .
Start all tests of current bufferC-c C-c ,
Start current test of cursor postitionC-c /
Toggle output window
C-c C-c k
Kill scriptC-c C-c e
Rails generateC-c C-c x
Rails destroyC-c C-c s c
Start Rails consoleC-c C-c w s
Start/Stop WebserverC-c C-c w i
Print Webserver statusC-c C-c w i
Auto open BrowserC-c C-c s s
Start SQL-BufferC-c M-Z
Start terminal consoleC-c C-c C-t
Generate and update TAGS fileC-c C-c r
Start rake tasks
C-c C-c d m
Run migrationsC-c C-c d v
Migrate to versionC-c C-c d v
Migrate to previous versionC-c C-c d u
Migrate version upC-c C-c d d
Migrate version down
C-c p
Create partial from selectionC-c b
Create helper from blockC-c s
Search in project
A big thanks to Dmitry Galinsky for starting this project and Remco van ’t Veer and the other contributors who helped to push/enhance this project.