# Where is the syntax error in this code?

**URL:** <https://www.ruby-forum.com/t/where-is-the-syntax-error-in-this-code/111798>\
**Category:** Rails\
**Created:** [August 10, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/where-is-the-syntax-error-in-this-code/111798 "2007-08-10T22:35:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmnmm7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@mmnmm7](https://www.ruby-forum.com/u/mmnmm7)\
**Post date:** [August 10, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/where-is-the-syntax-error-in-this-code/111798/1 "2007-08-10T22:35:34Z")

</div>

Hi.  
I am a beginner at Ruby and RoR.  
But I’m in truble now.

Please review below message;  
What is the syntax error in this code?

[code] ===========================================================

# Your Pragmatic Catalog

\<% for product in @products -%\>

 ![]()
### \<%= h(product.title) %\>
 \<%= product.description %\> \<%= number\_to\_currency(product.price) %\>

```
<%= form_remote_tag :url => { :action => :add_to_cart, :id =>

```

product } do %\>  
\<%= submit\_tag “Add to Cart” %\>  
\<%= end %\>

# 

  
\<% end %\>
## [Error Msg]

SyntaxError in Store#index  
Showing app/views/store/index.rhtml where line #11 raised:

compile error  
./script/…/config/…/app/views/store/index.rhtml:11: syntax error,  
unexpected ‘)’  
\_erbout.concat “\t\t”; \_erbout.concat(( form\_remote\_tag :url =\>  
{ :action =\> :add\_to\_cart, :id =\> product } do ).to\_s); \_erbout.concat  
“\n”

^  
./script/…/config/…/app/views/store/index.rhtml:13: syntax error,  
unexpected kEND  
\_erbout.concat “\t\t”; \_erbout.concat(( end ).to\_s); \_erbout.concat  
“\n”  
^  
./script/…/config/…/app/views/store/index.rhtml:16: syntax error,  
unexpected kEND, expecting ‘)’

Extracted source (around line #11):

8: \<%= number\_to\_currency(product.price) %\>\</  
span\>  
9:  
10:  
11: \<%= form\_remote\_tag :url =\> { :action =\> :add\_to\_cart, :id =\>  
product } do %\>  
12: \<%= submit\_tag “Add to Cart” %\>  
13: \<%= end %\>  
14:

Trace of template inclusion: /app/views/store/index.rhtml

=================================================================

---

<div class="post-metadata">

**Author:** ![mmnmm7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@mmnmm7](https://www.ruby-forum.com/u/mmnmm7)\
**Post date:** [August 10, 2007, 10:37pm UTC](https://www.ruby-forum.com/t/where-is-the-syntax-error-in-this-code/111798/2 "2007-08-10T22:37:34Z")

</div>

> ```
> <%= form_remote_tag :url => { :action => 
> 
> ```
> 
> :add\_to\_cart, :id =\> product } do %\>  
> \<%= submit\_tag “Add to Cart” %\>  
> \<%= end %\>

\<% form\_remote\_tag :url =\> { :action =\> :add\_to\_cart, :id =\> product }  
do %\>  
\<%= submit\_tag “Add to Cart” %\>  
\<% end %\>

- donald

---

<div class="post-metadata">

**Author:** ![mmnmm7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@mmnmm7](https://www.ruby-forum.com/u/mmnmm7)\
**Post date:** [August 10, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/where-is-the-syntax-error-in-this-code/111798/3 "2007-08-10T22:59:37Z")

</div>

Hi!

Thanks a lot!  
I get out of trouble.

mmnmm7.

On 8¿ù11ÀÏ, ¿ÀÀü5½Ã36ºÐ, “Ball, Donald A Jr (Library)”
