Render :partial F5 refresh problem

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

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

Best regards

Peter De Berdt

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs