# Verificare da dove proviene una redirect

**URL:** <https://www.ruby-forum.com/t/verificare-da-dove-proviene-una-redirect/203355>\
**Category:** IT\
**Created:** [February 18, 2011, 10:02am UTC](https://www.ruby-forum.com/t/verificare-da-dove-proviene-una-redirect/203355 "2011-02-18T10:02:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 18, 2011, 10:02am UTC](https://www.ruby-forum.com/t/verificare-da-dove-proviene-una-redirect/203355/1 "2011-02-18T10:02:11Z")

</div>

Controller Delivery:

def create  
@customer = Customer.find(params[:customer\_id])  
@delivery = @customer.deliveries.build(params[:delivery])  
@document = @customer.build\_document(params[:document])  
if @delivery.valid? and @document.valid?  
Delivery.transaction do  
@delivery.save!  
@document.save!  
end  
flash[:success] = “Consegna effettuata.”  
respond\_with(@customer)  
else  
@products = Product.all  
render ‘customers/show’, :layout =\> ‘delivery’  
end  
end

Come vedere se i due oggetti delivery e document vengono salvati  
avviene una redirect all’action show di customer.  
La stessa action show viene richiamata anche allo startup  
dell’applicazione a seguito di una search.  
Si puo’ verificare in qualche modo se la show proviene dalla create di  
Delivery?
