Skip to content

Instantly share code, notes, and snippets.

@keithpitt
Forked from dangalipo/gist:794581
Created January 25, 2011 06:53

Revisions

  1. keithpitt revised this gist Jan 25, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    @supplier_to = Supplier.find(params[:supplier_id])
    rescue ActiveRecord::RecordNotFound
    flash[:error] = "#{t('object.supplier')} #{t('messages.not_found')}"
    redirect_to manage_supplier_path(@supplier_from.id)
    return redirect_to(manage_supplier_path(@supplier_from.id))
    end

    render :merge_suppliers
  2. dangalipo created this gist Jan 25, 2011.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    def merge_suppliers
    @supplier_from = Supplier.find(params[:id])

    begin
    @supplier_to = Supplier.find(params[:supplier_id])
    rescue ActiveRecord::RecordNotFound
    flash[:error] = "#{t('object.supplier')} #{t('messages.not_found')}"
    redirect_to manage_supplier_path(@supplier_from.id)
    end

    render :merge_suppliers
    end