From: Philip Hallstrom Date: 2006-10-26T06:56:57+09:00 Subject: Re: Newbi - form_remote_tag doesn't produce any HTML > 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 That said... see below. > > I'm just following the Agile Web Development 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 %> 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. >
>
> <% end %> > __________________ > > Surprisingly, the HTML source that I see in the browser doesn't contain > any .js code. This is what I'm getting: > __________________ >
> src="http://www.onthegosoft.com/images/printer/passport_photo_small.png"/> >

Passport Photo

> Our great program for making passport picture! > $9.95 > > > >
>
>
> src="http://www.onthegosoft.com/images/photobackup/photo_backup_small.png"/> >

Photo Backup

>

Great program for backing up digital photos.

> > $29.95 > > >
>
> > __________________ > > 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 > > >