On 18 February 2011 13:02, Colin Law <[email protected]> wrote: > On 18 February 2011 11:53, Jim Ruther Nill <[email protected]> wrote: >> You can use request.env['HTTP_REFERER'] > > I would advise against that method. The view should not be making > decisions based on where it came from, it should be displaying what it > is told to display. If a particular action (create in this case) > requires something particular of a view then the action should tell > the view what to do by setting an @variable. The view should not be > saying 'I see that I came from the create action therefore I will > display this', it should be saying 'I see that this variable contains > this data so I will display the data as requested'. > > @Mauro, what is the difference you wish to see in the view based on > where it came from?
If the view is a redirect from Delivery create I want to see the message "create success" and a button "print" to print something. I the same view comes from the search customers action I want to see the message "already delivered" if customer.deliveries.count > 0 and a link "want to continue?" -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

