接收" ActionView ::缺少模板"在本地托管时出错?

时间:2014-05-18 01:42:03

标签: ruby-on-rails ruby ruby-on-rails-3 devise gem

尝试查看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"

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

简单回答是,您需要在/app/views/home/index.html.erbwebsite_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文件

,那将是一个很大的帮助