flaubert
2009-Jan-27 16:10 UTC
manipulating "params[:some]" with ActiveRecod::Find on ":select" method
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!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Jan-27 16:36 UTC
Re: manipulating "params[:some]" with ActiveRecod::Find on ":select" method
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---