sillyforum/app/controllers/replies_controller.rb
2026-03-17 12:49:38 +00:00

18 lines
349 B
Ruby

class RepliesController < ApplicationController
before_action :authenticate_user!
def create
id = params.extract_value(:forum_thread_id)[0]
reply = params[:reply]
body = reply["body"]
@reply = Reply.new(
user_id: current_user.id,
body: body,
thread_id: id
)
@reply.save
end
end