#encoding: utf-8 module Flyboy class TaskCommentsController < ::Flyboy::ApplicationController def create @task ||= Task.find(params[:task_id]) @task_comment ||= @task.comments.new(task_comment_params) authorize! :update, @task if @task_comment.save redirect_to @task else render "flyboy/tasks/show" end end private def permitted_params [:progress, :description] end def task_comment_params params.require(:task_comment).permit(permitted_params) end end end