# Simple RJS Calls Not Working

**URL:** <https://www.ruby-forum.com/t/simple-rjs-calls-not-working/91129>\
**Category:** Rails\
**Created:** [April 4, 2007, 11:35pm UTC](https://www.ruby-forum.com/t/simple-rjs-calls-not-working/91129 "2007-04-04T23:35:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Curran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8c91f0/32.png) [@Daniel\_Curran](https://www.ruby-forum.com/u/Daniel_Curran)\
**Post date:** [April 4, 2007, 11:35pm UTC](https://www.ruby-forum.com/t/simple-rjs-calls-not-working/91129/1 "2007-04-04T23:35:16Z")

</div>

I have a simlple view:

## Tags
\<% unless @recipe.tags.empty? %\> \<%= render :partial=\>'tags/tag', :collection=\>@recipe.tags %\> 

\<% end %\> \<% form\_remote\_tag :url=\>tags\_path(@recipe) do%\> Name \<%= text\_field\_with\_auto\_complete :tag, :name %\> \<%= submit\_tag "Add Tag" %\> \<% end %\>

Which has a pretty simple create method that renders the RJS as follows:

format.js {  
render :update do |page|  
page.insert\_html :bottom, ‘tags’, :partial=\>‘tags/tag’  
end  
}

The problem is that no insertion happens. Under IE I get an RJS alert,  
under FF I get nothing.  
Firebug reports that the POST request is successful and has the has  
the correct results:

try {  
new Insertion.Bottom(“tags”, "

\n Please Work\n Edit\n Delete\n\n"); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('new Insertion.Bottom(\"tags\", \"\\n Please Work\\n Edit\\n Delete\\n\\n\");\n'); throw e }

I threw the above JS into a test page and it works successfully, but  
for some reason it is not working through the form. Again, in IE the  
error is thrown, and in Fire Fox nothing is happenning at all. No  
warnings or errors are thrown.

Anyone have any ideas on what I am doing wrong?

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![Daniel\_Curran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8c91f0/32.png) [@Daniel\_Curran](https://www.ruby-forum.com/u/Daniel_Curran)\
**Post date:** [April 4, 2007, 11:51pm UTC](https://www.ruby-forum.com/t/simple-rjs-calls-not-working/91129/2 "2007-04-04T23:51:18Z")

</div>

Are the prototype and scriptaculous libraries listed in the head of  
the layout? I imagine that without them POST will still return the RJS  
but the browser wont do anything with it.

- Richard

---

<div class="post-metadata">

**Author:** ![Daniel\_Curran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8c91f0/32.png) [@Daniel\_Curran](https://www.ruby-forum.com/u/Daniel_Curran)\
**Post date:** [April 5, 2007, 12:45am UTC](https://www.ruby-forum.com/t/simple-rjs-calls-not-working/91129/3 "2007-04-05T00:45:22Z")

</div>

I have the following in the top of the HTML output, via \<%=  
javascript\_include\_tag :defaults %\>

IE is trying to do something with it, as the exception case is being  
thrown. I have not gone down the route of adding breakpoints into the  
Prototype library via Firebug to figure out what has been fired and  
what has not been fired. That will be my next step.

Another note is that text\_field\_with\_auto\_complete is working fine, so  
the javascript libraries are working and performing remote call  
successfully. It is just my form\_remote\_tag and the RJS that is not  
doing what I would expect it to.

The
