How to redirect back from action called from multiple controllers?

Hi,

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 rjs)?

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

Regards

redirect_to :back will do the referrer thing for you.

Fred

Thanks.

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?