Hello,
I am trying to implement the depot sample application of "Agile
programming with rails", everrithing goes good until came to AJAX
stuff,
When I changed the button_to for submit_tag I have no HTML code
generated for invoking the action using AJAX, I read the
troubleshooting section and everything is OK, any Idea of what could be
happening?
The code in index.rhml is
<% form_remote_tag :url => {:action => :add_to_cart, :id =>
product
} do %>
<%= submit_tag "Add to Cart" %>
<% end %>
and the resulting form has nothing, just a couple of blank lines in the
place that should show the button.
Thank you
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Mike wrote:> <% form_remote_tag :url =>You forgot the (Some forms use it and some don''t. No idea why!) -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip,
I tried two ways, and when use "=" sends an error
SyntaxError in Store#index
Showing app/views/store/index.rhtml where line #13 raised:
compile error
./script/../config/../app/views/store/index.rhtml:13: parse error,
unexpected '')''
_erbout.concat " "; _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:18: parse error,
unexpected kEND, expecting '')''
end ; _erbout
^
Any other idea?
Phlip ha escrito:
> Mike wrote:
>
> > <% form_remote_tag :url =>
>
> You forgot the >
> (Some forms use it and some don''t. No idea why!)
>
> --
> Phlip
> http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
>(Some forms use it and some don''t. No idea why!)<% form_for :item %> ... <% end %> Is a block, so it doesn''t use the =. It outputs what''s inside the block. <%= form_remote_tag %> Doesn''t have a block, it''s directly outputting the tag itself. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > I tried two ways, and when use "=" sends an error >^> ./script/../config/../app/views/store/index.rhtml:18: parse error, > unexpected kEND, expecting '')'' > end ; _erbout > ^ >take off the <% end %> tag, after you switch from <% form_remote_tag %> to <%= form_remote_tag %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jim,
The code is
<% form_remote_tag :url => {:action => :add_to_cart, :id => product
}
do %>
<%= submit_tag "Add to Cart" %>
<% end %>
it should generate a form with a submit button, but it doesn''t generate
any HTML code, just two blank lines, seems weird, isn''t?
Thank you
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
On 12/1/06, Mike <mguzman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> it should generate a form with a submit button, but it doesn''t generate > any HTML code, just two blank lines, seems weird, isn''t?I am using <%= form_tag :action => :agent_call_list%> <%= submit_tag -%> <%= end_form_tag %> raj --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---