sillyforum/app/controllers/forum_topics_controller.rb

24 lines
491 B
Ruby
Raw Permalink Normal View History

2026-03-17 12:49:38 +00:00
class ForumTopicsController < ApplicationController
def index
@threads = ForumThread.all
end
def show
2026-03-18 01:09:39 +00:00
@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)
2026-03-17 12:49:38 +00:00
end
2026-03-18 01:09:39 +00:00