Sha256: a49eddc5e53fde2a9ee818d96d0d6e85e9d391a304190a2aed20f66c350e889d

Contents?: true

Size: 699 Bytes

Versions: 46

Compression:

Stored size: 699 Bytes

Contents

module Incline
  class ContactController < ApplicationController

    allow_anon true

    ##
    # GET /incline/contact
    def new
      @msg = Incline::ContactMessage.new
    end

    ##
    # POST /incline/contact
    def create
      @msg = get_message
      if @msg.valid?
        @msg.remote_ip = request.remote_ip
        @msg.send_message
        flash[:success] = 'Your message has been sent.'
        redirect_to main_app.root_url
      else
        render 'new'
      end
    end

    private

    def get_message
      p = params.require(:contact_message).permit(:your_name, :your_email, :related_to, :subject, :body, :recaptcha)
      Incline::ContactMessage.new(p)
    end

  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
incline-0.3.14 app/controllers/incline/contact_controller.rb
incline-0.3.13 app/controllers/incline/contact_controller.rb
incline-0.3.12 app/controllers/incline/contact_controller.rb
incline-0.3.11 app/controllers/incline/contact_controller.rb
incline-0.3.10 app/controllers/incline/contact_controller.rb
incline-0.3.9 app/controllers/incline/contact_controller.rb
incline-0.3.8 app/controllers/incline/contact_controller.rb
incline-0.3.7 app/controllers/incline/contact_controller.rb
incline-0.3.6 app/controllers/incline/contact_controller.rb
incline-0.3.5 app/controllers/incline/contact_controller.rb
incline-0.3.4 app/controllers/incline/contact_controller.rb
incline-0.3.3 app/controllers/incline/contact_controller.rb
incline-0.3.2 app/controllers/incline/contact_controller.rb
incline-0.3.1 app/controllers/incline/contact_controller.rb
incline-0.3.0 app/controllers/incline/contact_controller.rb
incline-0.2.36 app/controllers/incline/contact_controller.rb
incline-0.2.35 app/controllers/incline/contact_controller.rb
incline-0.2.34 app/controllers/incline/contact_controller.rb
incline-0.2.28 app/controllers/incline/contact_controller.rb
incline-0.2.27 app/controllers/incline/contact_controller.rb