Sha256: b622ff2985fb623c53e59fb396b5780cc01b7dad512ab62a673f1cf1b70fafe8

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

module Spotlight
  class ContactFormsController < Spotlight::ApplicationController
    def new
      @contact_form = Spotlight::ContactForm.new :current_url => request.referer
    end

    def create
      @contact_form = Spotlight::ContactForm.new(contact_form_params)
      @contact_form.request = request

      if @contact_form.valid?
        @contact_form.deliver
        render 'show'
      else
        render 'new' 
      end
      
    end

    protected
    def contact_form_params
      params.require(:contact_form).permit(:name, :email, :message, :current_url)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-spotlight-0.0.2 app/controllers/spotlight/contact_forms_controller.rb
blacklight-spotlight-0.0.1 app/controllers/spotlight/contact_forms_controller.rb