# Manipulating "params\[:some\]" with ActiveRecod::Find on ":select" method

**URL:** <https://www.ruby-forum.com/t/manipulating-params-some-with-activerecod-find-on-select-method/158748>\
**Category:** Rails\
**Created:** [January 27, 2009, 5:12pm UTC](https://www.ruby-forum.com/t/manipulating-params-some-with-activerecod-find-on-select-method/158748 "2009-01-27T17:12:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [January 27, 2009, 5:12pm UTC](https://www.ruby-forum.com/t/manipulating-params-some-with-activerecod-find-on-select-method/158748/1 "2009-01-27T17:12:17Z")

</div>

Hello all,

I trying to pass the params from a form to the :select (field list) in  
my controller

like this =\> Processo.find :all,:conditions =\> {  
:tipo\_acao\_id =\>  
params[:tipo\_acao\_id],  
:fase\_id =\>  
(params[:fase\_id]),  
:resultado\_id =\>  
(params[:resultado\_id]),  
:situacao\_id =\>  
(params[:situacao\_id]),  
:justica\_id =\>  
(params[:justica\_id])  
}, :select =\>  
params[:some]

So, the SQL returns an error, the fields are going together w/o spaces  
or comma!

How to convert the params[:some] into a formatted string to make sql  
works:?:

tnks a lot!!!

---

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [January 27, 2009, 5:38pm UTC](https://www.ruby-forum.com/t/manipulating-params-some-with-activerecod-find-on-select-method/158748/2 "2009-01-27T17:38:22Z")

</div>

On 27 Jan 2009, at 16:10, flaubert wrote:

> So, the SQL returns an error, the fields are going together w/o spaces  
> or comma!
> 
> How to convert the params[:some] into a formatted string to make sql  
> works:?:

That entirely depends on what is in params[:some] (beware sql  
injection too - can’t remember to what extent AR protects you there)

Fred
