S
S
sanitar2010-11-05 18:55:34
JavaScript
sanitar, 2010-11-05 18:55:34

Redirect_to kills JS request in Rails 3?

The form with :remote => true submits the update of the record to the update method, which, in turn, if everything is fine, sends it via redirect_to to the show method, and show renders the js displaying the new record. And everything is fine in the opera, but under ff after the redirect to show, “as HTML” already leaves. How to force redirect too in JS?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
v1z, 2010-11-05
@sanitar

try instead of a redirect to make an action renderer, and write the flash like this:
flash.now[:notice] = 'Hello world!'
I'm not exactly sure, but I think that flash.now is exactly what you need

S
stel, 2010-11-05
@stel

Don't use rediret_to. Try calling the show method explicitly in the update method.

S
stel, 2010-11-05
@stel

I could be wrong, but it's worth trying
flash[:notice] = 'Hello world!'
before calling render

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question