I also tried those modes for RHTML and wasn’t too happy with them.
Then, I found the excellent rinari project
(http://rinari.rubyforge.org/), it’s a little bleeding-edge, but in my
experience it works great.
- Get it by checking it out of SVN.
svn checkout svn://rubyforge.org/var/svn/rinari
- Put something like the following in your .emacs:
; rinari mode
(add-to-list 'load-path “~/rinari”)
(add-to-list 'load-path “~/rinari/rhtml”)
(cons ‘("\.rhtml\’" . rhtml-mode) auto-mode-alist))
- 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.