It is minor mode for editing Ruby On Rails code with Emacs. This minor mode makes your work much easier and user friendly
Instalation
You need download last release from RubyForge page
http://rubyforge.org/projects/emacs-rails and and unpack it to directory containing libraries of Emacs, by default it’s $HOME/.emacs.d/
You can also use SVN
cd $HOME/.emacs.d/
svn co svn://rubyforge/var/svn/emacs-rails/trunk emacs-rails
Download and install required libraries
*
http://www.kazmier.com/computer/snippet.el
*
http://www.webweavertech.com/ovidiu/emacs/find-recursive.txt
Alert: From 0.44 release emacs-rails will require the inf-ruby.
After that you must add this code in $HOME/.emacs
(setq load-path (cons "~/.emacs.d/rails" load-path))
(defun try-complete-abbrev (old)
(if (expand-abbrev) t nil))
(setq hippie-expand-try-functions-list
'(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
(require 'rails)
For Windows users: you can use your help in CHM format (the default ri). This will require utility KeyHH. And add to a file .emacs
(setq rails-chm-file "full_path_to_rails_chm_manual")
After that you can run Emacs. Almost all available actions are in the menu [Ruby On Rails]. The snippets are in the menu [Ruby On Rails-Snippets], for the convenience, they are divided into categories.
To change default setting, select [Ruby On Rails – Customize].
First Acquaintance
Go to directory with your rails application and open any file in Emacs:
cd $HOME/project/simple_rails_application
emacs app/controllers/application.rb
There must be “RoR” sign in the list of active minor-modes in status bar. Thi means, that emacs-rails is enabled and ready to help you in your not so easy work.
Almoust all actions are in the “RubyOnRails” menu. You can check it out and try some of them. Don’t forget, that menu will help you only first time. After that you better use hot keys for effective work, you can find them in the brackets.
Features
* TextMate-like snippets
* Display of colored log files
* Integration with script/generate and script/destroy (controller, model, scaffold, migration, etc)
* Integration with script/console and script/breakpointer
* Run rake C-c C-c r
* Quick start svn-status in RAILS_ROOT f9
* Documentation search using ri or chm file and Rails API reference in HTML f1
* Quick access to the main configuration files
* Automatic TAGS generation in RAILS_ROOT directory
Management of WEBrick/Mongrel
* Your can select Webrick, Mongrel or Lighttpd
* Start/stop application server C-c C-c w s
* Automatic browsing on current action (from view or controller) C-c C-c w a
Navigation in RAILS_ROOT hierarchy
* Quick switch stylesheets, javascripts, migrations, layouts, helpers, controllers, models, observers, plugins
* In controller file: go to views, functional test, helper C-down
* Switch between action/view С-up
* Go to file in current line (example: cursor at line [redirect_to controller => :home, :action => “show”], will be open action “show” in “home” controller) C-RET
* Quick access to the main configuration files using menu
Other hot keys
* C-c C-c g g rails-nav:goto-migrate
* C-c C-c g j rails-nav:goto-javascripts
* C-c C-c g s rails-nav:goto-stylesheets
* C-c C-c g l rails-nav:goto-layouts
* C-c C-c g h rails-nav:goto-helpers
* C-c C-c g c rails-nav:goto-controllers
* C-c C-c g m rails-nav:goto-models
* C-c C-c g o rails-nav:goto-observers
* C-c C-c g p rails-nav:goto-plugins
ERb refactoring
* Create partial from selection C-c p
* Create helper from block C-c b
http://dima-exe.ru/rails-on-emacs