Sha256: fd3db35e6806bf452c72cf49d9b55201335aeb973240077702880a62b4d262ca

Contents?: true

Size: 736 Bytes

Versions: 51

Compression:

Stored size: 736 Bytes

Contents

require_dependency "think_feel_do_engine/application_controller"

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

51 entries across 51 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.9 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.8 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.7 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.6 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.5 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.4 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.3 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.2 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.1 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.19.0 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.18.0 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.17.2 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.17.1 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.17.0 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.16.3 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.16.2 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.16.1 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.15.7 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.16.0 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
think_feel_do_engine-3.15.6 app/controllers/think_feel_do_engine/participants/thoughts_controller.rb