Permalink
Browse files

fix rails-nav:create-new-layout

  • Loading branch information...
1 parent f6f5c80 commit 80a42a1c2df9daed71ea73448aca1640e65b37be @remvee remvee committed Jun 10, 2009
Showing with 6 additions and 3 deletions.
  1. +6 −3 rails-navigation.el
View
@@ -180,9 +180,12 @@
"Create a new layout."
(let ((name (or name (read-string "Layout name? "))))
(when name
- (rails-core:find-file (rails-core:layout-file name))
- (if (y-or-n-p "Insert initial template? ")
- (insert rails-layout-template)))))
+ (let* ((default-type (or rails-controller-layout:recent-template-type (car rails-templates-list)))
+ (type (completing-read (format "Create %s.[%s]? " name default-type)
+ rails-templates-list nil t default-type)))
+ (rails-core:find-file (rails-core:file (format "app/views/layouts/%s.%s" name type)))
+ (if (y-or-n-p "Insert initial template? ")
+ (insert rails-layout-template))))))
(defun rails-nav:goto-layouts ()
"Go to layouts."

0 comments on commit 80a42a1

Please sign in to comment.