# \[Ajax and RJS\] :bottom is null

**URL:** <https://www.ruby-forum.com/t/ajax-and-rjs-bottom-is-null/187118>\
**Category:** Rails\
**Created:** [April 17, 2010, 2:38pm UTC](https://www.ruby-forum.com/t/ajax-and-rjs-bottom-is-null/187118 "2010-04-17T14:38:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [April 17, 2010, 2:38pm UTC](https://www.ruby-forum.com/t/ajax-and-rjs-bottom-is-null/187118/1 "2010-04-17T14:38:52Z")

</div>

Hello,  
I ma following ryanb screencast about Ajax, and i am trying to add an  
element to my list using ajax and RJS. My problem is that my object is  
correctly inserted but the rendering isn’t working because the “bottom”  
property is null…

Here is the error:  
try {  
Element.insert(“message\_list”, { after: null });  
} catch (e) { alert(‘RJS error:\n\n’ + e.toString());  
alert(‘Element.insert(“message\_list”, { after: null });’); throw e }

Here is my RJS File:  
page.insert\_html :after, :message\_list, :render =\> “message”, :object =\>  
@message

And here is my html code

 \<%=render :partial =\> "message", :collection =\> @messages%\> \<%if can? :create, Message.new %\> - \<%= render :partial =\> "form"%\>
 \<%end%\>

Any clue?
