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 へのルートはすべて正常に機能します。以下にそれらの呼び出し方法を含めます。見つからないのはよくある質問のビューだけです。ビューの場所も含めます。(リンクは、本番環境ではなく、ローカルホスト環境でビューを見つけます) Heroku を使用してアプリケーションをデプロイしています。

views/landings/faq.html.erb は存在します

4

1 に答える 1