Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why was :overwrite_params deprecated in Rails 3

With overwrite_params, I was doing this to prepare a PDF request for a page:

 url_for(:overwrite_params => {:format => :pdf}) 

overwrite_params has been deprecated after Rails 2.3.8, is there a reason for this deprecation? What's the standard accepted alternative?

like image 212
Samer Buna Avatar asked Sep 06 '10 00:09

Samer Buna


1 Answers

This is what your looking for:

url_for params.merge(:format => "PDF", :only_path => false)

This will create an absolute url for the current page including the current params.

like image 142
Tim Santeford Avatar answered Sep 18 '22 16:09

Tim Santeford