Hello,
I’m trying to get new site section working…
I’ve got .json part succesfully serving data (http://localhost/faq_categories.json)
But for HTML request (http://localhost/faq_categories) Discourse generates 404 not found “Oops! That page doesn’t exist or is private”. I do have proper erb.html file in place.
I think that routing is working correctly (otherwise there would be error). Is there any part of Discourse application that would prevent me to run this simple code correctly?
Can you please help me to find what am I missing? Thanks a lot…!
/discourse/config/routes.rb
get “/faq_categories” => “faq_categories#index”
/discourse/app/controllers/faq_categories_controller.rb
class FaqCategoriesController < ApplicationController
def index
@faq_categories = FaqCategory.all
respond_to do |format| format.html do render :index end format.json do render_serialized(@faq_categories, FaqCategorySerializer) end end
end
end
discourse/app/views/faq_categories/index.html.erb
`
Frequently Asked Questions
`