Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CommentsController < ApplicationController
- def new
- @job_task = JobTask.find params[:job_task_id]
- @comment = Comment.new
- end
- def create
- @job_task = JobTask.find params[:job_task_id]
- @comment = Comment.new(comment_params)
- @comment.user = current_user
- if @comment.save
- return redirect_to new_job_task_comment_url(@job)
- end
- end
- private
- def comment_params
- params.require(:comment).permit(:comment)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement