1

以下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 %>

着陆控制器 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

路线.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'

about 和 contact 的路线都可以正常工作,我将在下面说明我如何称呼它们。只是faq视图找不到,我也将视图在哪里。(该链接确实在我的 localhost 环境中找到了视图,而不是在生产环境中)我正在使用 Heroku 部署我的应用程序。

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

4

1 回答 1

-1

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

于 2013-06-07T20:42:00.473 回答