Redirect_to(:action => ...) usage?


#1

I’ve a number of places in my rails application where I have
redirects, but I find they are not always redirected. I think
part of the problem is that my understanding of pre-requisites
is insufficient. I’m not sure how to frame a search to get the
answer I need. I’m using Rails 0.14.3 under cygwin with ruby 1.8.2

How do I make sure that data received in @params[] on my first page
is transformed correctly to the appropriate parameter names for the
page to which I redirect? What I’m doing, to make this more
concrete, is creating a loans system, and when somebody attempts to
borrow an item that supposedly has not been returned, for example,
then I wish to redirect the browser to the returns form, filling in
the details that I have (such as the barcode just scanned off the
object). Then I can re-issue the item cleanly. Do I need to set
instance vars, or change @params[various,…]? I seem to recall
that there was an alternative to redirect_to() which I now can’t
find in Agile Web D. with Rails, though I may be thinking
of the part where it explains about calling render only once.

Any suggestions about common causes of failure in this area would be
welcome. Sorry about the lack of a well-formed question.

    Thank you,
    Hugh