Adding Query String to Link

I am using ThickBox/jQuery for an app. With it I need to be able to add
a query string to the end of a dynamically generated URL. For example

This is how my links are generated

<%= link_to @testimonial.customer, testimonial_url(:id =>, :class => ‘thickbox’ %>

How do I add the query string to the end of that URL?

I found a semi working solution in :anchor like

<%= link_to @testimonial.customer, testimonial_url(:id =>, :anchor => ‘?height=300&width=300’), :class =>
‘thickbox’ %>

But I would like to do it right so I know there are no bugs.

Jeremy L. wrote:

I ran into the same issue last week and your code led me to the
Looks like unreserved keys that are passed to the options hash url_for,
which is what testimonial_url calls down the line, get turned into query
string params. So:

<%= link_to @testimonial.customer, testimonial_url(:id =>, :height => 300, :width => 300), :class =>
‘thickbox’ %>

Thanks for helping me! Hope this helps you.

Ryan Carmelo Briones

View this message in context:
Sent from the RubyOnRails Users mailing list archive at