Sha256: 946e5abbea11ef47384641e7dae5f2726ab181e70efa373d2211058d5e747801

Contents?: true

Size: 460 Bytes

Versions: 1

Compression:

Stored size: 460 Bytes

Contents

class E9Crm::ContactMergesController < E9Crm::BaseController
  before_filter :build_resources

  def create
    @contact_a.attributes = params[:contact]

    if @contact_a.merge_and_destroy!(@contact_b)
      redirect_to @contact_a
    else
      render :new
    end
  end

  protected

  def build_resources
    @contact_a ||= Contact.find(params[:contact_a_id])
    @contact_b ||= Contact.find(params[:contact_b_id])
    @contact   ||= Contact.new
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
e9_crm-0.1.20 app/controllers/e9_crm/contact_merges_controller.rb