Syntax error

Does my below code make sense…is it right?
<%@profile = UserPrivilege.find_all_by_user_id(4)%>

<%= options_from_collection_for_select(Profile.find(:all,:conditions =>
{:id => “#{@profile.map{|s| s.profile_id}}”},‘id’,‘name’)%>

i get the below error when i run it…

Development/app/views/reports/_list.rhtml:116: syntax error, unexpected
‘,’, expecting tASSOC
…map{|s| s.profile_id}}"},‘id’,‘name’)).to_s); @output_buffer

/Development/app/views/reports/_list.rhtml:116: syntax error, unexpected
‘)’, expecting kEND
…ile_id}}"},‘id’,‘name’)).to_s); @output_buffer.concat “\n”

Any helps

On 12 February 2010 09:22, Newb N. [email protected] wrote:

<%= options_from_collection_for_select(Profile.find(:all,:conditions =>
{:id => “#{@profile.map{|s| s.profile_id}}”},‘id’,‘name’)%>

This line opens two brackets, but only closes one. Probably your
problem.

On Feb 12, 2010, at 4:22 AM, Newb N. wrote:

Does my below code make sense…is it right?
<%@profile = UserPrivilege.find_all_by_user_id(4)%>

<%= options_from_collection_for_select(
Profile.find(:all,
:conditions => { :id => “#{@profile.map{|s|
s.profile_id}}” },
‘id’,
‘name’)
%>

What are those other two arguments to find?

Does that help you see where the closing delimiter is missing? :wink:

‘)’, expecting kEND
[email protected].
To unsubscribe from this group, send email to [email protected]
.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
.

Rob B. http://agileconsultingllc.com
[email protected]