Weird problem with RUBY and AJAX (form_remote_tag and submit_tag)

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

Jeff Pritchard ha escrito:

Mike wrote:
> Hello,
>
> The code in index.rhml is
>
>
> <% form_remote_tag :url => {:action => :add_to_cart, :id => product
>
>
> and the resulting form has nothing, just a couple of blank lines in the
>
> place that should show the button.
>

You left off the = on the opening <%, so the form_remote_tag line
doesn't output anything.

In general, you use <% for "figuring things out", like setting a
variable to the result of a calculation, and you use <%= for lines where
you want the stuff in there to create some output into the html stream.

jp

--
Posted via http://www.ruby-forum.com/.

Tried also that but didn't work, still trying.

Thank you