How to redirect back from action called from multiple controllers?


I've got a model i.e. Ticket, which has it's own edit page. There's
also i.e. Report controller which has a view where I can edit i.e. one
field of Ticket and Project controller where I can edit other field of
Ticket object.

The question is: how to use only one update method in Ticket
controller and write redirect part in a simple way, so it will
redirect back to the action from which it was called (or execute some

Should I send some additional parameter or use HTTP_REFERER and make
case statement for redirecting/rendering rjs? Is there some simpler


redirect_to :back will do the referrer thing for you.



This will work for html, s half of the problem is gone :slight_smile: But what
about ajax request where I need to render specific rjs file?