# Javascript refresh...?

**URL:** <https://discuss.rubyonrails.org/t/javascript-refresh/55721>\
**Category:** rubyonrails-talk\
**Created:** [November 15, 2010, 8:38pm UTC](https://discuss.rubyonrails.org/t/javascript-refresh/55721 "2010-11-15T20:38:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pete6](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@Pete6](https://discuss.rubyonrails.org/u/Pete6)\
**Post date:** [November 15, 2010, 8:38pm UTC](https://discuss.rubyonrails.org/t/javascript-refresh/55721/1 "2010-11-15T20:38:37Z")

</div>

Hi

I am trying to refresh the contents of a page after selecting certain options on a drop-down list.

I have created the drop down as such:

\<%= select\_tag "itemSelect", options\_for\_select(['All', 'Latest'], 'All'), { :onchange =\> remote\_function( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:with =\> 'Form.Element.serialize(this)', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:url =\> {:action =\> 'finishedItems'}) } %\>

This passes back the correct value to the controller, and I use this to change values in a named\_scope to generate the relevant content in the rest of the page.

However I am unsure of how to refresh this content, without completely reloading the page,

Is this where render\_partial comes in useful?

P.S - I am not gathering any id's from the database directly in the select, it is just a local function for refreshing data on the page.

---

<div class="post-metadata">

**Author:** ![Juan\_Pablo\_Avello](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Juan\_Pablo\_Avello](https://discuss.rubyonrails.org/u/Juan_Pablo_Avello)\
**Post date:** [November 16, 2010, 8:11am UTC](https://discuss.rubyonrails.org/t/javascript-refresh/55721/2 "2010-11-16T08:11:38Z")

</div>

If you are using rails 2 you may want to check examples for 'observe\_field' and 'observe\_form' helpers; they'll use ajax to update your page without reloading it. If you are using rails 3 you'll have to find their new counterparts, as these 2 are deprecated. Unfortunately I can't give more info about this since I'm slightly outdated with R3.

Regards
