March 1st, 2007, 02:09 PM
Swapping key names in a hash
I'm trying to change the name of a hash key. I want to take a params[:value] and modify some of it's key names to work better in model sql statements.
for instance I have a param hash key named "title" (params['title']) and I want to change that key name to 'spaces.title' so it will work better w/in a conditional statement in joined table sql call.
March 2nd, 2007, 12:22 PM
Sweet - found my solution and here it is:
params[:account]['spaces.title'] = params[:account][:title]
Always simpler than I think.