Link_to with changing one single get-param

Hey…

i want to sort some of my data-tables with an application-helper named
“sortable(fieldname)”

in this helper i want to define a link with following schema,
depending on params[:direction]:
link_to fieldname, request.url + ‘?order=desc’ (or asc)

but this link isn’t correct if I click on it several times:

http://localhost:3000/drafts/222/stats_details?direction=asc?order=Kontakt&direction=desc?order=Kontakt&direction=asc?order=Kontakt&direction=asc?order=Kontakt&direction=asc

Can somebody give me a hint?

Thanks!

found it by myself:

link_to ‘linkname’, params.merge({ ‘sort’ => column, ‘order’ =>
order })