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

On Jul 7, 7:42 pm, szimek [email protected] wrote:

Hi,

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

redirect_to :back will do the referrer thing for you.

Fred

On 7 Lip, 21:15, Frederick C. [email protected] wrote:

On Jul 7, 7:42 pm, szimek [email protected] wrote:> Hi,

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

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?