Files
fizzy/app/controllers/comments_controller.rb
T
2024-08-19 14:14:26 -05:00

20 lines
367 B
Ruby

class CommentsController < ApplicationController
before_action :set_splat
def create
@comment = @splat.comments.create(comment_params)
@comment.save
redirect_to splat_path(@splat)
end
private
def comment_params
params.require(:comment).permit(:body)
end
def set_splat
@splat = Splat.find(params[:splat_id])
end
end