Sha256: b9d9555dc1558e6d291e7b48975e7b24e287cf6b32ad0997cf99f780361abc89

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

class Dorsale::Flyboy::TaskCommentsController < ::Dorsale::Flyboy::ApplicationController
  def create
    @task_comment ||= model.new(task_comment_params)
    @task_comment.author = current_user

    @task = @task_comment.task

    authorize! :update, @task

    if @task_comment.save
      redirect_to @task
    else
      render "dorsale/flyboy/tasks/show"
    end
  end

  private

  def model
    ::Dorsale::Flyboy::TaskComment
  end

  def permitted_params
    [
      :task_id,
      :progress,
      :description,
    ]
  end

  def task_comment_params
    params.fetch(:task_comment, {}).permit(permitted_params)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dorsale-3.0.3 app/controllers/dorsale/flyboy/task_comments_controller.rb