Jonathan Simms
2005-Oct-14 16:27 UTC
can''t seem to get params correctly formatted using redirect_to
Ok, so i have a nested @params structure
{"cost"=>{"weight"=>nil,
"value"=>"[40,65)"}, "freetext"=>
{"value"=>"dill"},
"action"=>"results",
"drill_down_search"=>"yes",
"controller"=>"search",
"zipcodes"=>{"value"=>"10003"},
"enhanced_search"=>"Search"}
i have a redirect_to to handle a condition where my search engine
comes up with no results
def handle_empty_result_set_exception(exception)
args = @params.merge({''controller'' =>
"oops", ''action'' =>
''no_results''}).symbolize_keys
logger.debug_yaml("redirect_to args") { args }
redirect_to args
end
but when the redirect happens, it massacres the params into an
incorrect form:
{"cost"=>"value[40, 65)",
"freetext"=>"valuedill",
"geoloc"=>"zipcode10003",
"drill_down_search"=>"yes",
"zipcodes"=>"value10003",
"enhanced_search"=>"Search"}
it doesn''t seem to handle the parameterization of nested structures
properly, which seems like a bug (?)
I have my own code to do this correctly, but it seems like this
should be a common thing for people to want to do, am i missing
something obvious?
Any advice?
Jonathan
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails