On 07 Sep 2007, at 16:59, Igor K. wrote:
> 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?
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---