Forum: Ruby on Rails question on rails , form_remote_tag and backbase

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F202428c618fd90555b844dbd081b42b?d=identicon&s=25 bob mines (Guest)
on 2005-11-25 19:11
David,

I been reading your book and going through the examples but i am stuck
on th using the form_remote_tag.

I am using the Backbase  ajax framework  with rails and protoype.js

The following form.rhtml file

<% if @guess %>
        <p> It seeems '<%=h @guess %>' is hardly the right answer</p>
<% end %>

<%= form_remote_tag(:update => "update_div",
                        :url  => {:action => :guess } ) %>

     <label for="guess">Ruby on ....? </label>
     <%= text_field_tag :guess %>
     <%= submit_tag "Post with Ajax" %>
<%= end_form_tag %>

and template file

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ><html
xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/b"
xmlns:s=" http://www.backbase.com/s">
<head>
<s:execute xmlns="http://www.w3.org/1999/xhtml"
xmlns:b="http://www.backbase.com/b "
xmlns:s="http://www.backbase.com/s">

<script type="text/javascript" src="/Backbase/3_1/bpc/boot.js"
></script>
<%= javascript_include_tag "prototype" %>
</head>

<body onload="bpc.boot ('/Backbase/3_1/');">
<xmp backbase="true">
<b:box>

<div id="update_div">
        <%= render(:partial => 'form') %>
 </div>
</b:box>
</xmp>
</body>
</html>
~


It generates the html below

?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=
"http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/b
" xmlns:s="http://www.backbase.com/s">
<head
>
<s:execute xmlns="http://www.w3.org/1999/xhtml"
xmlns:b="http://www.backbase.com/b" xmlns:s="
http://www.backbase.com/s">

<script type="text/javascript"
src="/Backbase/3_1/bpc/boot.js" ></script>
<script src=
"/javascripts/prototype.js" type="text/javascript"></script>
</
head>

<body onload="bpc.boot('/Backbase/3_1/');">
<b:box
>

<div id="update_div">


<form
 action="/refi/guess" method="post"
onsubmit="new Ajax.Updater('update_div', '/refi/guess',
{asynchronous:true, evalScripts:true, parameters:Form.serialize(this)});
return false;">

     <
label for="guess">Ruby on ....? </label>
     <input
 id="guess" name="guess" type=
"text" />
     <input name="commit"
type="submit" value="Post with Ajax" />
</
form>


 </div>
</b:box>

</body>
</
html>



but the backbase box "<b:box>" disappears when i submit the form and the
url changes to .../guess instead of doing a partial update.

If i take out the backbase code the rails/ruby code works as it should.

Any suggestions? thx.

bob
This topic is locked and can not be replied to.