Sha256: 9e66830b72093c2da193de49a16e1c1a4b091b91d2dbf900a16cd48027fa07e4

Contents?: true

Size: 641 Bytes

Versions: 8

Compression:

Stored size: 641 Bytes

Contents

require_dependency "bootstrap_feedbacker/application_controller"

module BootstrapFeedbacker
  class RemarksController < ApplicationController

    # POST /remarks
    def create
      @remark = Remark.new(remark_params.merge(user_id: current_user.id))
      @remark.source_url = request.env['HTTP_REFERER'] || "no referrer"
      if @remark.save
        FeedbackMailer.feedback(@remark).deliver_now
        respond_to do |format|
          format.js
        end
      end
    end

    private

    # Only allow a trusted parameter "white list" through.
    def remark_params
      params.require(:remark).permit(:content)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bootstrap_feedbacker-0.4.3 app/controllers/bootstrap_feedbacker/remarks_controller.rb
bootstrap_feedbacker-0.4.2 app/controllers/bootstrap_feedbacker/remarks_controller.rb
bootstrap_feedbacker-0.4.1 app/controllers/bootstrap_feedbacker/remarks_controller.rb
bootstrap_feedbacker-0.4.0 app/controllers/bootstrap_feedbacker/remarks_controller.rb
bootstrap_feedbacker-0.3.5 app/controllers/bootstrap_feedbacker/remarks_controller.rb
bootstrap_feedbacker-0.3.4 app/controllers/bootstrap_feedbacker/remarks_controller.rb
bootstrap_feedbacker-0.3.3 app/controllers/bootstrap_feedbacker/remarks_controller.rb
bootstrap_feedbacker-0.3.0 app/controllers/bootstrap_feedbacker/remarks_controller.rb