sillyforum/app/controllers/forum_topics_controller.rb
2026-03-18 01:09:39 +00:00

23 lines
491 B
Ruby

class ForumTopicsController < ApplicationController
def index
@threads = ForumThread.all
end
def show
@category = Category.find(params[:category_id])
#@forum_topics = ForumTopic.all
#@forum_thread = @category&.forum_topics&.forum_thread(params[:forum_thread_id])
@forum_topic = @category.forum_topics.find(params[:id])
@forum_threads = @forum_topic.forum_threads
end
end
private
def params
params.require(:forum_topic, :title).permit( :description)
end