Forum: Ruby on Rails Change URL without actually changing?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ben J. (Guest)
on 2007-04-19 06:52
Is it possible to change the URL in the browser window without actually
going there? I know I've seen flash apps do this. Yahoo maps is an
example.

Thanks for your help.
Daniel F. (Guest)
on 2007-04-19 07:06
(Received via mailing list)
This is called AJAX.

Ruby on Rails has excellent support for it.

http://api.rubyonrails.org/classes/ActionView/Help...

On Apr 18, 7:52 pm, Ben J. <removed_email_address@domain.invalid>
Ben J. (Guest)
on 2007-04-19 07:36
Daniel F. wrote:
> This is called AJAX.
>
> Ruby on Rails has excellent support for it.
>
> http://api.rubyonrails.org/classes/ActionView/Help...
>
> On Apr 18, 7:52 pm, Ben J. <removed_email_address@domain.invalid>

Right, I want to basically add a feature to AJAX. When I change content
on my page I would like to change the URL in the browser window so users
can bookmark it. Is this possible? This way I get the benefits of URLs
without having to reload the page.
Andy T. (Guest)
on 2007-04-19 07:37
(Received via mailing list)
Here's a link explaining how to change the URL without refreshing the
page (for instance to allow the back button to be used with ajax)

http://www.contentwithstyle.co.uk/Articles/38/fixi...
and-enabling-bookmarking-for-ajax-apps
Rob S. (Guest)
on 2007-04-19 08:36
(Received via mailing list)
On 4/18/07, Ben J. <removed_email_address@domain.invalid> wrote:
> Right, I want to basically add a feature to AJAX. When I change content
> on my page I would like to change the URL in the browser window so users
> can bookmark it. Is this possible? This way I get the benefits of URLs
> without having to reload the page.

You want to use window.location.  Its not strictly ajax, its just
javascript.

here ya go:

http://www.google.com/search?q=window.location+changing+url

- rob

--
http://robsanheim.com
http://seekingalpha.com
Peter De Berdt (Guest)
on 2007-04-19 12:22
(Received via mailing list)
On 19 Apr 2007, at 06:35, Rob S. wrote:

>>> On Apr 18, 7:52 pm, Ben J. <removed_email_address@domain.invalid>
> javascript.
>
> here ya go:
>
> http://www.google.com/search?q=window.location+changing+url

Wouldn't that trigger a reload of the page? You could have a look at
StateManager from the exanimo site, it's the only AJAX state manager
I've found to work quite reliably on all browsers (including Safari).


Best regards

Peter De Berdt
Rob S. (Guest)
on 2007-04-19 14:20
(Received via mailing list)
On 4/19/07, Peter De Berdt <removed_email_address@domain.invalid> wrote:
>
> Ruby on Rails has excellent support for it.
> <removed_email_address@domain.invalid>
> without having to reload the page.
> here ya go:
>
> Best regards
>
>
>
>
> Peter De Berdt
>

No, not if you just modify the hash (aka fragment identifier - the
piece after the '#').

see: http://ajaxpatterns.org/Unique_URLs#Solution

- Rob

--
http://robsanheim.com
http://seekingalpha.com
This topic is locked and can not be replied to.