Rails中缺少模板错误

时间:2013-06-07 20:38:27

标签: ruby-on-rails ruby

以下link_to位于我的landings / index.html.erb中。当我点击链接时,链接会在着陆页上正确显示:

 ActionView::MissingTemplate (Missing template landings/faq, application/faq with
 Searched in:   * "/app/app/views"

着陆/ index.html.erb

 <%= link_to "Learn more by reading our Frequently Asked Questions", faq_path %>

Landings controller app / controllers / landings_controller.rb

 class LandingsController < ApplicationController

    def about

    end

    def contact

    end

    def faq

    end

    def terms

    end

    def privacy 

    end

    def blog

    end


  end

的routes.rb

 root :to => "landings#index"
  match '/about',    to: 'landings#about'
  match '/contact',  to: 'landings#contact'
  match '/faq',      to: 'landings#faq'
  match '/terms',    to: 'landings#terms'
  match '/privacy',  to: 'landings#privacy'
  match '/blog',     to: 'landings#blog'

路线到约和联系所有工作正常,我将包括我在下面打电话给他们。它只是找不到的常见问题视图,我还将包括视图所在的位置。 (该链接确实在我的localhost环境中找到了视图,而不是生产)我正在使用Heroku部署我的应用程序。

views / landings / faq.html.erb确实存在

1 个答案:

答案 0 :(得分:0)

由于我在帖子中看到的内容,在app/app/views中搜索了rails,您可能只有app/views/landings/faq.html.erb。尝试将文件复制到app/app/views/landings/faq.html.erb以查看其是否有效。