我有这条路线:
scope :module => :mobile, :as => :mobile do
constraints(:subdomain => /m/) do
devise_for :users, :path => "", :path_names =>
{ :sign_in => "login", :sign_out => "logout",
:sign_up => "signup" },
:controllers => {:sessions => "mobile/sessions"}
resources :home
resources :disclosures # Will have new, get, look up a disclosure
end
end
这个控制器:
class Mobile::SessionsController < ApplicationController
def create
end
end
在这个目录下:/app/views/mobile/sessions/new.html.haml
这是 new.html.haml 文件中的代码:
= content_for :page_title do
= t :page_title_login
= content_for :primary_content do
#login_box
.span6
#traditional-login
.span4
= content_for :before_closing_body_tag do
configure_login_form(#{request.xhr?.to_s.downcase});
但是登录后,我在浏览器中收到此错误:
Missing template mobile/sessions/create, application/create with {:locale=>[:en, :en], :formats=>[:html], :handlers=>[:haml, :erb, :builder]}. Searched in: * "/Users/alexgenadinik/projects/cmply/cmply-app/app/views" * "/Library/Ruby/Gems/1.8/gems/ckeditor-3.6.3/app/views" * "/Library/Ruby/Gems/1.8/gems/kaminari-0.13.0/app/views" * "/Library/Ruby/Gems/1.8/gems/devise-2.0.4/app/views"
这向我表明系统认为我没有 new.html.haml 文件。但我显然有那个文件。所以我不确定是什么问题。并知道我做错了什么?
提前致谢!!