newb
1
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
newb
2
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.
newb
3
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? 
‘)’, 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]