url_for or resource_url additional params?

if i want a link to book_url(@book), but i want to pass an additional
param, how to i do that?

i want it to result in something like http://localhost/books/1?foo=bar

this works, but seems hackish:

url_for(:controller => book_path(@book), :foo => "bar", :only_path =>

book_url(:id => @book, :foo => 'bar')

You have to use the hash format even for the :id when you want to add other parameters.


Rob Biedenharn http://agileconsultingllc.com