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] ==========================================================
<h1>Your Pragmatic Catalog</h1>
<% for product in @products -%>
<div class="entry">
<img src="<%= product.image_url%>" />
<h3><%= h(product.title) %></h3>
<%= product.description %>
<span class="price"><%= number_to_currency(product.price)
%></span>
<%= form_remote_tag :url => { :action => :add_to_cart, :id =>
product } do %>
<%= submit_tag "Add to Cart" %>
<%= end %>
</div>
<% 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: <span class="price"><%=
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: </div>
Trace of template inclusion: /app/views/store/index.rhtml
================================================================
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Ball, Donald A Jr (Library)
2007-Aug-10 20:36 UTC
Re: where is the syntax error in this code?
> <%= 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi! Thanks a lot! I get out of trouble. mmnmm7. On 8월11일, 오전5시36분, "Ball, Donald A Jr (Library)" <donald.b...-GjtI+QwuxAR68HQyEA6aog@public.gmane.org> wrote:> > <%= 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---