Add symbol in collection_select helper

hi,
i have a collection_select helper wich i retrieve a select multiple with
the names of my reports:

<%= f.collection_select :report_ids, @reports, :id, :name, {}, {
:multiple => true, :size => 10 } %>

but now i want to add the “surname” field to the list selectable.
i have tryed:

<%= f.collection_select :report_ids, @reports, :id, “#{:name}
#{:surname}” , {}, { :multiple => true, :size => 10 } %>

but i obtain an error.
what is the correct sintax?

thanks

<%= f.select :report_ids, @reports.map { |r| ["#{r.name}
#{r.surname}", r.id] } , {}, :multiple => true, :size => 10 %>

Maurício Linhares
http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr

On Mon, Aug 24, 2009 at 5:57 AM, Aldo

hi
I am new to rails, here why dont we use a method which is not a
table attribute but a user defined one which is defined as we need
like display of both surname and name concatenated.
i tried but i am getting error pls clarify me thanks in advance

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs