Sha256: 8f78130955e103371fb45653810ce8f0ae38695fc8331dcc75957bbff47310bd

Contents?: true

Size: 569 Bytes

Versions: 2

Compression:

Stored size: 569 Bytes

Contents

module Fullstack
  module Contacts
    module Actions

      extend ActiveSupport::Concern
      
      included do
      end

      protected

      def create_contact!(options = {})
        
        options = { 
          :failure => "contacts"
        }.merge(options)
        
        @contact = Contact.new(params[:contact])
        if @contact.save
          redirect_to options[:success], :flash => {:notice => t("contacts.success", :default => "Thank you for contacting us")}
        else
          render options[:new]
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fullstack-contacts-0.1.4 lib/fullstack/contacts/actions.rb
fullstack-contacts-0.1.3 lib/fullstack/contacts/actions.rb