Forum: Ruby on Rails manipulating "params[:some]" with ActiveRecod::Find on ":select" method

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D1f3d779854573da0340bf53b0b625cc?d=identicon&s=25 flaubert (Guest)
on 2009-01-27 17:12
(Received via mailing list)
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!!!
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-01-27 17:38
(Received via mailing list)
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
This topic is locked and can not be replied to.