Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding url parameters with redirect_to

Is it possible to pass url parameters with this type of redirect_to?

redirect_to contact_path(@contact), :show_family => 'yes'

I want a URL that results in:

/contacts/1?show_family=yes
like image 328
Steve Avatar asked Feb 04 '10 22:02

Steve


1 Answers

Yes, just pass your query string parameters in to contact_path:

redirect_to contact_path(@contact, :show_family => 'yes')
like image 162
Alex Reisner Avatar answered Oct 11 '22 13:10

Alex Reisner