rails.elの設定ではまった

色々バグフィックスされているがまったくリリースする気なさげなので最新を取得しておく.

$ svn co http://emacs-rails.rubyforge.org/svn/trunk/

yasnippetとの相性

ちょっと併用して使えないので

(add-hook 'rails-minor-mode-hook
 	  '(lambda ()
 	     (yas/minor-mode-off)))

でオフした.

Ctr+Enter

rails.elでは,

render :partial => "hoge"
render :action => "fuga"

などの部分でCtr+Enterを押すとそのテンプレートに飛んでくれる.
しかし,".rhtml"拡張子にしか対応してない.
最近のRailsでは".html.erb"を使うのでこれを修正した.

Index: rails-core.el
===================================================================
--- rails-core.el       (リビジョン 232)
+++ rails-core.el       (作業コピー)
@@ -236,14 +236,14 @@
   "Return the file name of partial NAME."
   (if (string-match "/" name)
       (concat "app/views/"
-        (replace-regexp-in-string "\\([^/]*\\)$" "_\\1.rhtml" name))
+        (replace-regexp-in-string "\\([^/]*\\)$" "_\\1.html.erb" name))
     (concat (rails-core:views-dir (rails-core:current-controller))
-      "_" name ".rhtml")))
+      "_" name ".html.erb")))
 
 (defun rails-core:view-name (name)
   "Return the file name of view NAME."
   (concat (rails-core:views-dir (rails-core:current-controller))
-          name ".rhtml")) ;; BUG: will fix it
+          name ".html.erb")) ;; BUG: will fix it
 
 (defun rails-core:helper-file (controller)
   "Return the helper file name for the controller named
@@ -669,6 +669,6 @@
 
 (defun rails-core:rhtml-buffer-p ()
   "Return non nil if the current buffer is rhtml file."
-  (string-match "\\.rhtml$" (buffer-file-name)))
+  (string-match "\\.html.erb$" (buffer-file-name)))
 
 (provide 'rails-core)
Index: rails-view-minor-mode.el
===================================================================
--- rails-view-minor-mode.el    (リビジョン 232)
+++ rails-view-minor-mode.el    (作業コピー)
@@ -43,7 +43,7 @@
           (insert  "\n")
           (split-window-vertically)
           (other-window 1)
-          (find-file (concat "_" name ".rhtml"))
+          (find-file (concat "_" name ".html.erb"))
           (goto-char (point-min))
           (erase-buffer)
           (insert content)

かなりアドホックだけど..まぁいいか.