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
=================================================================