7b2ecf5d1a
This doesn't actually work but I thought I'd leave it in since it's a reproducible case for: https://github.com/hotwired/turbo/issues/211
20 lines
401 B
Ruby
20 lines
401 B
Ruby
class CommentsController < ApplicationController
|
|
before_action :set_splat
|
|
|
|
def create
|
|
@comment = @splat.comments.create(comment_params)
|
|
@comment.save
|
|
|
|
redirect_to splat_path(@splat, anchor: "comment_#{@comment.id}")
|
|
end
|
|
|
|
private
|
|
def comment_params
|
|
params.require(:comment).permit(:body)
|
|
end
|
|
|
|
def set_splat
|
|
@splat = Splat.find(params[:splat_id])
|
|
end
|
|
end
|