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.
328f0bb678423fcea01ebe3b0edc74e6?d=identicon&s=25 Ben Johnson (benjohnson)
on 2007-04-19 04: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.
07cef9a7f74a2df39fbc3af8d0d0d9a4?d=identicon&s=25 Daniel Fischer (arachnd)
on 2007-04-19 05: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 Johnson <rails-mailing-l...@andreas-s.net>
328f0bb678423fcea01ebe3b0edc74e6?d=identicon&s=25 Ben Johnson (benjohnson)
on 2007-04-19 05:36
Daniel Fischer 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 Johnson <rails-mailing-l...@andreas-s.net>

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.
3726bda7f0d852f7e8296fb0d69aa9e0?d=identicon&s=25 Andy Triboletti (Guest)
on 2007-04-19 05: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
Df5e7adb20adae6c120b04e7cafb15a0?d=identicon&s=25 Rob Sanheim (rsanheim)
on 2007-04-19 06:36
(Received via mailing list)
On 4/18/07, Ben Johnson <rails-mailing-list@andreas-s.net> 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
00973881979aa0a660ffbbb2f7a907fb?d=identicon&s=25 Peter De Berdt (Guest)
on 2007-04-19 10:22
(Received via mailing list)
On 19 Apr 2007, at 06:35, Rob Sanheim wrote:

>>> On Apr 18, 7:52 pm, Ben Johnson <rails-mailing-l...@andreas-s.net>
> 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
Df5e7adb20adae6c120b04e7cafb15a0?d=identicon&s=25 Rob Sanheim (rsanheim)
on 2007-04-19 12:20
(Received via mailing list)
On 4/19/07, Peter De Berdt <peter.de.berdt@pandora.be> wrote:
>
> Ruby on Rails has excellent support for it.
> <rails-mailing-l...@andreas-s.net>
> 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.