# Render :partial F5 refresh problem

**URL:** <https://www.ruby-forum.com/t/render-partial-f5-refresh-problem/114075>\
**Category:** Rails\
**Created:** [September 7, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/render-partial-f5-refresh-problem/114075 "2007-09-07T16:59:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![demoversion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4491bb/32.png) [@demoversion](https://www.ruby-forum.com/u/demoversion)\
**Post date:** [September 7, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/render-partial-f5-refresh-problem/114075/1 "2007-09-07T16:59:35Z")

</div>

hello,

who know how to fix problem with refreshing web-page,

i have a controller welcome with index.rhtml and \_page1.rhtml,  
\_page1.rhtml.  
in index.rhtm i have a div with id=‘main-context’,  
and i render :partial =\> ‘page1’ to this div  
and i also have a link to render :partial =\> ‘page2’ with  
RJS(replace\_html).

the problem is when i click on link to page2, my div(id=‘main-conten’)  
changed with text from \_page2.rhtm(thats perfect) but when i pressed F5  
to refresh browser i moved to index page and it’s render \_page1.rhtml.

how can i change a part of web page(with partials) and posibility to  
refresh web-page with last partial?

Thanks

---

<div class="post-metadata">

**Author:** ![demoversion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4491bb/32.png) [@demoversion](https://www.ruby-forum.com/u/demoversion)\
**Post date:** [September 7, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/render-partial-f5-refresh-problem/114075/2 "2007-09-07T17:12:07Z")

</div>

On 07 Sep 2007, at 16:59, Igor K. wrote:

> changed with text from \_page2.rhtm(thats perfect) but when i  
> pressed F5  
> to refresh browser i moved to index page and it’s render \_page1.rhtml.
> 
> how can i change a part of web page(with partials) and posibility to  
> refresh web-page with last partial?

You’ve stumbled upon the school example of when to use ajax and when  
not to. You should only use ajax if refreshing the page will yield  
the same results, at least that’s how I see it (and probably a lot of  
people will agree with me).

That said, there are workarounds using javascript, but you’ll have to  
implement and handle it in your rails app yourself:  
[http://exanimo.com/javascript/using-the-statemanager-in-ajax-apps](http://exanimo.com/javascript/using-the-statemanager-in-ajax-apps)

Best regards

Peter De Berdt
