Perfect, yes I was concentred to the map and I didnt look the execute


On Fri, 8 Jan 2010 08:57:09 -0800 (PST), Frederick Cheung
<frederick.che...@gmail.com> wrote:
> On Jan 8, 4:17 pm, Quijote70 <sergio.angele...@gmail.com> wrote:
>>     @langs = ActiveRecord::Base.connection.execute (@sql)
>>
>> then in the view i want to create a select box
>>
>>     <%= select("lang", "lang_id", @langs.map {|p| [ p.name, p.id ] })
>> %>
>>
>> can you explain why it dont work?
>>
> execute returns a database specific result set object (eg
> Mysql::Result for mysql etc.). You probably want something like
> select_all that returns an array of hashes
> 
> Fred
>> Sergio
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to