# RJS and different views

**URL:** <https://www.ruby-forum.com/t/rjs-and-different-views/168308>\
**Category:** Rails\
**Created:** [May 19, 2009, 1:24pm UTC](https://www.ruby-forum.com/t/rjs-and-different-views/168308 "2009-05-19T13:24:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [May 19, 2009, 1:24pm UTC](https://www.ruby-forum.com/t/rjs-and-different-views/168308/1 "2009-05-19T13:24:40Z")

</div>

I have Results Controller. It has an index action with a corresponding  
index view.  
In the view their is a search form which is sent to a search action in  
the same controller. I wanted to seperate this from the index action  
because its pretty heavy and involves backgroundrb, scraping etc.

Once the results are scraped in the search action I want to go back to  
the index view and add them there.

whats best practice. So far i can see 2 ways to do this.  
i can either manipulate the index view within the search action somehow  
or  
i can somehow pass teh results to the index controller and let it do  
ajax updates on its own view.

How do i go about this? If i page.redirect\_to :url =\> “index” - it will  
reload the index page all over again and I dont want that.

(im fairly new to ajax / rails so perhaps overlooking something )
