Many Thanks Bill.
First, here is what shows in firebug for that partial which creates a
form:
<div id="whereabouts">
<form id="edit_associate_1" class="edit_associate"
name="whereaboutsform" method="post" action="/associates/1">
<div style="margin: 0pt; padding: 0pt;">
<input type="hidden" value="put" name="_method"/>
<input type="hidden" value="yE+PvOnafqUVEYfQqxhY/ThAvtdW3zoyh
+FkXfDLdNo=" name="authenticity_token"/>
</div>
<label for="associate_inoutexplanation">
Hello
<b>Janna</b>
please update your whereabouts || tell us what you're doing:
</label>
<br/>
<input id="associate_inoutexplanation" type="text" value="This is
Sunday msg #1 " size="30" name="associate[inoutexplanation]"/>
<input id="associate_submit" class="button" type="submit"
value="Update" name="commit"/>
<script type="text/javascript">
1
2//<![CDATA[
3new Form.Element.EventObserver('inoutexplanation', function(element,
value) {new Ajax.Request('/channels/speakassfromwhereaboutspartial',
{asynchronous:true, evalScripts:true,
parameters:'associate_inoutexplanation=' + value +
'&authenticity_token=' + encodeURIComponent('yE+PvOnafqUVEYfQqxhY/
ThAvtdW3zoyh+FkXfDLdNo=')})})
4//]]>
5
</script>
</form>
</div>
So far so good. Now, I update the text field, submit, and look at it
again in firebug:
<div id="whereabouts">
<form id="edit_associate_1" class="edit_associate"
name="whereaboutsform" method="post" action="/associates/1">
<div style="margin: 0pt; padding: 0pt;">
<input type="hidden" value="put" name="_method"/>
<input type="hidden" value="yE+PvOnafqUVEYfQqxhY/ThAvtdW3zoyh
+FkXfDLdNo=" name="authenticity_token"/>
</div>
<label for="associate_inoutexplanation">
Hello
<b>Janna</b>
please update your whereabouts || tell us what you're doing:
</label>
<br/>
<input id="associate_inoutexplanation" type="text" value="This is
Sunday msg #2" size="30" name="associate[inoutexplanation]"/>
<input id="associate_submit" class="button" type="submit"
value="Update" name="commit"/>
<script type="text/javascript">
1
2//<![CDATA[
3new Form.Element.EventObserver('inoutexplanation', function(element,
value) {new Ajax.Request('/channels/speakassfromwhereaboutspartial',
{asynchronous:true, evalScripts:true,
parameters:'associate_inoutexplanation=' + value +
'&authenticity_token=' + encodeURIComponent('yE+PvOnafqUVEYfQqxhY/
ThAvtdW3zoyh+FkXfDLdNo=')})})
4//]]>
5
</script>
</form>
</div>
Notice that the value for the message has changed in the textfield, of
course, but the action I am trying to call
channels.speakassfromwhereaboutspartial, doesn't get called, because
in it I have a puts statement:
def speakassfromwhereaboutspartial
puts "speakassfromwhereaboutspartial"
boxchangedata
puts params['associate_inoutexplanation']
offToServer 0,current_associate.username,
current_associate.username, "@speakass
"+current_associate.channelselectedassoc,:channelnotes => params
['associate_inoutexplanation']
end
So it appears that somehow my observe_field is not observing -- or
likely not observing what I want it to! -Janna