Sha256: 1d9ad218b414b59d98c615d03c214e39e1877a0c768e9cea9d331eec219d90e5

Contents?: true

Size: 670 Bytes

Versions: 4

Compression:

Stored size: 670 Bytes

Contents

module ThinkFeelDoEngine
  module Participants
    # Manage Participant Thoughts.
    class ThoughtsController < ApplicationController
      before_action :authenticate_participant!

      def create
        @thought = current_participant.thoughts.find(thought_id)
        @thought.update(thought_params)
      end

      private

      def thought_id
        params[:thoughts][:commit_id].keys.first || -1
      end

      def thought_params
        params.require(:thoughts)
          .permit(thought_id => [
            :content, :effect, :pattern_id,
            :challenging_thought, :act_as_if
          ])
          .fetch(thought_id)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
think_feel_do_engine-3.10.9 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.10.8 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.10.7 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.10.6 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb