I’ve checked my books, google, API… I don’t get it. A redirect_to
doesn’t really start a wholly new request. Code after a redirect_to
still gets processed. The original request code isn’t terminated.
I’ve checked my books, google, API… I don’t get it. A redirect_to
doesn’t really start a wholly new request. Code after a redirect_to
still gets processed. The original request code isn’t terminated.
A) what’s the sense in that?
B) how prevent it?
redirect_to is just a function. it would be a big magic if it could
interrupt the flow of code if you want to you can always return after
the redirect.
In this particular case I’d put you check_session_nit_expired in a
before_filter (redirecting does stop the filter chain). This is
usually mentioned pretty explicitly in tutorials etc…
I’ve checked my books, google, API… I don’t get it. A redirect_to
doesn’t really start a wholly new request. Code after a redirect_to
still gets processed. The original request code isn’t terminated.
A) what’s the sense in that?
B) how prevent it?
redirect_to is just a function. it would be a big magic if it could
interrupt the flow of code
Hmmm. A simple Ruby abort command would do. In my previous Lasso
life, a redirect including aborting the current request. In old
versions we had to add the abort command manually after the redirect,
but recent versions of the language finally added the abort
internally, and made it a param option to not abort which was a much
more logical way to go. Doesn’t seem that magical to me.
if you want to you can always return after the redirect.
sure, but that doesn’t stop the processing from continuing in the
previous method which called the current one having the rediect –
which was the scenario I painted.
In this particular case I’d put you check_session_nit_expired in a
before_filter (redirecting does stop the filter chain). This is
usually mentioned pretty explicitly in tutorials etc…
I’ve juggled some things, but still not getting what I want. Looks
like I have to reorganize quite a bit. I was counting on that
redirect killing off the current request.
Seems I’ve just gotten “lucky” until now.
– gw
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.