# Adding a bit of ajax to rails question

**URL:** <https://www.ruby-forum.com/t/adding-a-bit-of-ajax-to-rails-question/136123>\
**Category:** Rails\
**Created:** [April 29, 2008, 5:25am UTC](https://www.ruby-forum.com/t/adding-a-bit-of-ajax-to-rails-question/136123 "2008-04-29T05:25:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 29, 2008, 5:25am UTC](https://www.ruby-forum.com/t/adding-a-bit-of-ajax-to-rails-question/136123/1 "2008-04-29T05:25:09Z")

</div>

Hi, I just started playing to add some ajax to my RoR application.  
works… but something weird is going on that is most problably a newbee  
error than anything else.  
I have this code in one of my views…

\<%= link\_to\_remote( "click here to show your jid's", :update =\> "list\_jids", :url =\>{ :controller =\> 'xmpp', :action =\> 'listadmin', :id =\> @authreg.id } ) %\>

when I click the link “click here to show your jid’s”  
it shows the jid’s but it loads all my menus again like basically  
reading my application.rhtml file  
again instead of just showing the information pulled from my xmpp  
controller…  
Any ideas on how to clean the results so it loads the results not the  
whole page inside the page again?

Thanks.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 29, 2008, 6:37am UTC](https://www.ruby-forum.com/t/adding-a-bit-of-ajax-to-rails-question/136123/2 "2008-04-29T06:37:50Z")

</div>

render with  
render :layout =\> false  
?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 29, 2008, 10:22am UTC](https://www.ruby-forum.com/t/adding-a-bit-of-ajax-to-rails-question/136123/3 "2008-04-29T10:22:44Z")

</div>

exactly 🙂

_render :layout=\> false_

at end of action in controller

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 30, 2008, 6:45am UTC](https://www.ruby-forum.com/t/adding-a-bit-of-ajax-to-rails-question/136123/4 "2008-04-30T06:45:41Z")

</div>

Hi… I was all excited to try this after work… got home and nothing…  
I still have the same issue… I added what you guys suggested to this:  
\<%= render :layout =\> false, :partial =\> ‘list’, :collection =\> @xmppr  
%\>

and I still get the whole page in… ☹

alexey.Creopolis wrote:

> > ?
> > 
> > > ```
> > > :update => "list_jids",
> > > 
> > > ```
> > > 
> > > Thanks.

–  
A Spectre is haunting multinational capitalism–the spectre of free  
information.  
All the powers of ``globalism’’ have entered into an unholy alliance to  
exorcize this spectre:  
Microsoft and Disney, the World Trade Organization, the United States  
Congress and the European Commission.  
Eben Moglen from the FSF.  
[http://emoglen.law.columbia.edu/publications/dcm.html](http://emoglen.law.columbia.edu/publications/dcm.html)

Solidarity:  
[http://www.dailyradical.org](http://www.dailyradical.org)  
[http://www.diarioradical.org](http://www.diarioradical.org)  
[http://www.spboston.org](http://www.spboston.org)

> **[MESSIPOKER - Situs Judi Slot Online Dan Toto 4D Togel Terbaru](https://binaryfreedom.info/)**
>
> MESSIPOKER ialah situs judi slot online terbaik dan toto 4D online terpercaya no 1 di Indonesia yang siap memberikan pelayanan maksimal kepada anda.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 30, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/adding-a-bit-of-ajax-to-rails-question/136123/5 "2008-04-30T16:40:36Z")

</div>

that render :layout =\> false goes at the end of the controller method.
