I’m trying to get a collection_select generated Drop-down box to display
two fields from a table (first name & last name); however, I am having
trouble concatenating the symbols. It appears as though any code I put
in the 5th argument for collection_select is processed prior to
executing the collection_select method. The code executes successfully
with 1 symbol in the 5th argument, but not when trying to concatenate 2.
Any help is appreciated!
My code is below:
this works:
<%=collection_select(:model_name, :field_name, @queryname, :id,
:field_name_1)%>
executing the collection_select method. The code executes successfully
with 1 symbol in the 5th argument, but not when trying to concatenate 2.
Any help is appreciated!
Hey Ryan,
Yeah, that’s not gonna work. The helper is using object.send to call a
method by using the symbol you pass it. I’m new to this, but try
defining a new single method on your object which returns the
concatenated string. Pass a symbol for that new method to
collection_select.