Forum: Ruby on Rails rhtml in emacs

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
0b99e4c88649ccfa84ba8b59bdc92b4a?d=identicon&s=25 Lalala Liliil (lalala)
on 2007-01-28 06:11
Hi everyone, I've just started to learn ruby on rails.
I decided to use emacs as my editor.
I managed to get emacs recognize rb files.
I'm having trouble on editing rhtml files.
I'd like to turn on the auto ident and syntax highlight but not sure on
how to do it.

I have mmm-mode, nxml-mode, rhtml-minor-mode and emacs-rails0.52 in my

Thank you
752a5de591cde4f99adbe9e479d48884?d=identicon&s=25 sness (Guest)
on 2007-01-28 08:08
(Received via mailing list)
Hi there,

I also tried those modes for RHTML and wasn't too happy with them.
Then, I found the excellent rinari project
(, it's a little bleeding-edge, but in my
experience it works great.

1) Get it by checking it out of SVN.

svn checkout svn://

2) Put something like the following in your .emacs:

; rinari mode
(add-to-list 'load-path "~/rinari")
(add-to-list 'load-path "~/rinari/rhtml")
(setq auto-mode-alist
     (cons '("\\.rhtml\\'" . rhtml-mode) auto-mode-alist))
(require 'rinari)

3) Then either restart Emacs, or use "M-x load-file ~/.emacs" to
reload your .emacs file

They've got some great integration with Rails going on in the rinari
package, one of the ones I use a lot is extract-partial.  To use this
one, you mark a region in your .rhtml file, then go "M-x
extract-partial", rinari will create a new .rhtml file with the code
in your region and will insert a <%= render :partial => for you.

This topic is locked and can not be replied to.