:select with select helper

Here is an interesting behavior that I have noticed is rather common
with R0R. I have two select helpers being used in a form. Both are
supposed to display a list of stuff, but if either should already have
an item in that list accosiated with a value in the table it should
display that value in the list. However, one does and one does not. Here
is the code:

<%= select ‘bar’, ‘account_id’, Account.find_by_sql( “SELECT
accounts.accountcode ||’ '|| accounts.name AS accountcode, id from
accounts
ORDER BY accounts.accountcode ASC” ).collect{ |a| [a.accountcode,
a.id] }, :selected => @bar.account_id %>

This one works perfectly well and display the correct selected item.

<%= select ‘enpseudo’, ‘pseudocity’, Enpseudo.find( :all ).collect{ |a|
[a.pseudocity, a.id] }, :selected => @enpseudo.pseudocity %>

This one, however, does not display the correct item in the list if one
is aleardy present in the table. I have checked the output and the
output it gives does indeed match an item in the list but it is
odviously not making the accassiation. Any suggestions of what I am
doing wrong? Thanks

-Shandy

I realized what I was doing. I was trying to match what was betwen the

tags and not what was in the value of the tag. And that value was an idea and not a string of whatever characters.