尝试查看Rails应用程序,但是当我在本地托管它时,我收到以下错误消息:
Missing template website_builder_engine/home/index, website_builder_engine/application/index with {:handlers=>[:erb, :builder, :coffee], :formats=>[:html], :locale=>[:en, :en]}. Searched in: * "/Users/MyName/orange-peacock/app/views" * "/Users/MyName/.rvm/gems/ruby-1.9.3-p545@mygemset/gems/frontend-helpers-0.1.3/app/views" * "/Users/MyName/.rvm/gems/ruby-1.9.3-p545@mygemset/gems/website_builder_engine-0.0.5/app/views" * "/Users/MyName/.rvm/gems/ruby-1.9.3-p545@mygemset/gems/devise-2.2.8/app/views"
有什么想法吗?
答案 0 :(得分:0)
简单回答是,您需要在/app/views/home/index.html.erb
或website_builder_engine/home/index.html.erb
-
我认为此问题不在于devise
本身,而在于您如何访问应用中的路线。我想你正在重定向到一个不存在的路由(在unauthentication上)(I.E home#index
):
#config/routes.rb
root to: "home#index"
devise_for :users, path_names: { sign_in: "login" } #-> routes to views/devise/login
解决此问题的方法是确保您拥有可用的视图,并确保devise
将在身份验证时重定向到正确的路径
-
如果您发布了routes
文件