I have two tables, table A has a has_many relationship to table B.
to create an entry in table B, I have a link on the form_page of object A, redirecting to object B’s new page.
I want in the create function of object B to be able to redirect to a different page, based on where the request originated from, i.e. object A’s new page, or object A’s edit page. Is this possible? I saw in the conn object theres a before_send object, but I couldn’t figure out how to use it
This will confuse the user as he opens multiple tabs.
Always provide the “redirect_to” as a (hidden) field in a form or as a parameter in the query string. Also fall back to sensible defaults when it is missing.