I have a callback url string params[:callback]
and I need to append a query string \"&result=true\"
and redirect the user. The better way I found o
I think you're pretty close to optimal. you could crush out a line or two, but it doesn't really gain you anything.
callback = Addressable::URI.parse(params[:callback])
callback.query_values = callback.query_values.merge {:results => 'true' }
redirect_to callback.to_s
If the callback is always inside your application, you might have some other options with varying degrees of coolness, but you didn't specify if that was the case or not.