# Syntax error

**URL:** <https://www.ruby-forum.com/t/syntax-error/183355>\
**Category:** Rails\
**Created:** [February 12, 2010, 10:22am UTC](https://www.ruby-forum.com/t/syntax-error/183355 "2010-02-12T10:22:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [February 12, 2010, 10:22am UTC](https://www.ruby-forum.com/t/syntax-error/183355/1 "2010-02-12T10:22:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [February 12, 2010, 10:26am UTC](https://www.ruby-forum.com/t/syntax-error/183355/2 "2010-02-12T10:26:58Z")

</div>

On 12 February 2010 09:22, Newb N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [February 12, 2010, 3:30pm UTC](https://www.ruby-forum.com/t/syntax-error/183355/3 "2010-02-12T15:30:44Z")

</div>

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  
> removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to removed\_email\_address@domain.invalid  
> .  
> For more options, visit this group at [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en)  
> .

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
