Sha256: 327258e68588222353c894b320cd6cd7209114183991acddd3e3b7c7bbef5b1e

Contents?: true

Size: 759 Bytes

Versions: 26

Compression:

Stored size: 759 Bytes

Contents

module Renalware
  module System
    class UserFeedbackController < BaseController
      def new
        feedback = UserFeedback.new
        authorize feedback
        render_new(feedback)
      end

      def create
        feedback = UserFeedback.new(user_feedback_params)
        feedback.author = current_user
        authorize feedback

        if feedback.save
          redirect_to root_url, notice: "Feedback registered, thank you"
        else
          render_new(feedback)
        end
      end

      private

      def render_new(feedback)
        render :new, locals: { feedback: feedback }
      end

      def user_feedback_params
        params
          .require(:feedback)
          .permit(:comment, :category)
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.15 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.14 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.13 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.12 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.11 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.9 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.8 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.7 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.5 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.4 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.3 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.2 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.1 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.0 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.0.pre.rc13 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.0.pre.rc11 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.0.pre.rc10 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.0.pre.rc9 app/controllers/renalware/system/user_feedback_controller.rb
renalware-core-2.0.0.pre.rc8 app/controllers/renalware/system/user_feedback_controller.rb