# Problem in using sorthelper2

**URL:** <https://www.ruby-forum.com/t/problem-in-using-sorthelper2/172869>\
**Category:** Rails\
**Created:** [July 29, 2009, 6:41am UTC](https://www.ruby-forum.com/t/problem-in-using-sorthelper2/172869 "2009-07-29T06:41:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mushi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@mushi](https://www.ruby-forum.com/u/mushi)\
**Post date:** [July 29, 2009, 6:41am UTC](https://www.ruby-forum.com/t/problem-in-using-sorthelper2/172869/1 "2009-07-29T06:41:46Z")

</div>

Hi  
i am using SortHelper2 in my columns and want someone help to solve my  
problem.

i have the following url on my site

> **[.xyz Domain Names | Join Generation XYZ](https://gen.xyz/)**
>
> .xyz is for every website, everywhere.® We offer the most flexible and affordable domain names to create choice for the next generation of internet users.

and i want to append  
sort\_key=id&sort\_order=desc

at the end of my params hash, so the end result would be

[http://xyz.ccom/post?options=vteam&sort\_key=id&sort\_order=desc](http://xyz.ccom/post?options=vteam&sort_key=id&sort_order=desc)

Would any body help me how i can append  
sort\_key=id&sort\_order=desc  
at the end of my query string.

Thanks in advance

mushii

---

<div class="post-metadata">

**Author:** ![mushi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@mushi](https://www.ruby-forum.com/u/mushi)\
**Post date:** [July 29, 2009, 12:29pm UTC](https://www.ruby-forum.com/t/problem-in-using-sorthelper2/172869/2 "2009-07-29T12:29:56Z")

</div>

Hi  
Eventually i have been able to solve problem myself.

i made the following modification in the sort\_link method

if params[:options]  
my\_condition = params[:options]  
end

params = {:params =\> {:options =\> my\_condition , :sort\_key =\> sort\_key,  
:sort\_order =\> order, :search\_terms =\> terms}}

and i got the desired results which i was looking for 🙂
