(defun my/projectile-rails-find-current-x (x)
(interactive
(list (completing-read "> " '("model" "view" "controller"
"migration" "helper"
"javascript" "stylesheet"
"serializer"
"spec" "test" "fixture"))))
(call-interactively (intern (concat "projectile-rails-find-current-" x))))
(defun my/in-rails-project-p ()
(< 0 (length
(shell-command-to-string
(format "grep Rails %s"
(projectile-rails-expand-root "Rakefile"))))))
(defun my/projectile-rails-setup-keys ()
(interactive)
(when (my/in-rails-project-p)
(local-set-key (kbd "C-c c") 'projectile-rails-console)
(local-set-key (kbd "C-c x") 'my/projectile-rails-find-current-x)
))
(add-hook 'find-file-hook 'my/projectile-rails-setup-keys)