# Newbi - form\_remote\_tag doesn't produce any HTML

**URL:** <https://www.ruby-forum.com/t/newbi-form-remote-tag-doesnt-produce-any-html/73655>\
**Category:** Ruby\
**Created:** [October 25, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/newbi-form-remote-tag-doesnt-produce-any-html/73655 "2006-10-25T23:50:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [October 25, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/newbi-form-remote-tag-doesnt-produce-any-html/73655/1 "2006-10-25T23:50:50Z")

</div>

Hi,

I’m completely new to Ruby/Rails, so sorry for asking newbi questions.

I’m just following the Agile Web D. book, and got to the AJAX  
section.  
Added the code from the web, to generate the .js which triggers the  
AJAX, but no .js code appears in the HTML.

This is what I’ve added to the .rhtml code (from the book):

* * *

\<% 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 %\> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Surprisingly, the HTML source that I see in the browser doesn’t contain  
any .js code. This is what I’m getting:

* * *

### Passport Photo
 Our great program for making passport picture! $9.95

```
  <br clear="all"/>

```

### Photo Backup

**Great program** for backing up **digital photos**.

```
<span class="price">$29.95</span>

  <br clear="all"/>

```

* * *

Notice, just before the   
 tag at the end, a .js snippet should  
appear, triggering the AJAX.  
Any advice how I can debug this?

Thanks,  
Amir

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [October 25, 2006, 11:58pm UTC](https://www.ruby-forum.com/t/newbi-form-remote-tag-doesnt-produce-any-html/73655/2 "2006-10-25T23:58:51Z")

</div>

> I’m completely new to Ruby/Rails, so sorry for asking newbi questions.

You might get better luck asking the Rails list…

[http://groups.google.com/group/rubyonrails-talk?lnk=srg&hl=en](http://groups.google.com/group/rubyonrails-talk?lnk=srg&hl=en)

That said… see below.

> ![]()
> 
> ### \<%= 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 %\>

I think form\_remote\_tag/do is edge rails… are you using edge? if  
you’re  
not, change that, and don’t forget to change “\<% form…” to “\<%=  
form…”, so they actually output something.
