Forum: Ruby on Rails Nested params and redirect_to

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
15050e11f16301e15da9970a82d2a62f?d=identicon&s=25 giorgio (Guest)
on 2007-07-25 00:26
(Received via mailing list)
I have a simple client search screen that posts the following params:

  Parameters: {"search"=>"Search", "action"=>"list",
"client_search"=>{"first_name"=>"jane", last_name"=>"smith"},

This works fine. However I want to redirect to the same destination to
do the search without the intervening screen.
I have used the code:
    redirect_to :action=>"list", :client_search=>{:first_name =>

This does not work.. the parameters appear as:
  Parameters: {"action"=>"list",

ie it is not nesting the "client_search" hash and I get the following
error when trying to update the attributes on the client_search table
using these params:
NoMethodError (undefined method `stringify_keys!' for
active_record/base.rb:1668:in `attributes='
active_record/base.rb:1591:in `update_attributes'

Can anyone tell me what I am doing wrong and how to get around the

Ab0b702e7fcc79bb7d2c6c67f64e1b4d?d=identicon&s=25 tmac (Guest)
on 2007-07-25 00:57
(Received via mailing list)
try out the flash:

flash[:client_search] = params[:client_search]

they should then be available in the flash to the next controller
instance invoked by the redirect.

good luck
15050e11f16301e15da9970a82d2a62f?d=identicon&s=25 giorgio (Guest)
on 2007-07-25 01:14
(Received via mailing list)
If I do that then the other action that is being redirected to will
have to read from flash sometimes and sometimes just use params. I
really want to redirect to it as if I was coming from the search

This topic is locked and can not be replied to.