Using rails 2. I want a link to the current page (whatever it is) that keeps all of the params the same but changes the format to \'csv\'. (setting the format can be done b
@floor's answer was great, I found it very useful.
Although the method can be improved by using the to_params method rather than contructing your own, like so:
def current_url(new_params) params.merge!(new_params) "#{request.uri}#{params.to_params}" end