You can always change the URL via the JavaScript property
window.location. However, if you set it, you''ll get redirected to
that URL. The standard AJAX solution is to set window.location.hash,
which will modify the URL to indicate state change, but will not
redirect user to a new page. More can be learned from http://ajaxpatterns.org/,
just search for ''bookmarkability''.
Eric
On Jul 31, 9:46 am, Justin To
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I have an ajax form. When it doesn''t get saved, I just
> params[:not_saved] = true
> render :action => :index
>
> view:
> <% if params[:not_saved] %>
> //show the form
> <% end %>
>
> On the form, I have a link_to_remote "Cancel" to close the ajax
form,
> but hitting cancel doesn''t change the url. This is the
URL:http://localhost:4000/auth_user/save_requirement.
>
> rjs:
> page[:form].visual_effect :slide_up
>
> How can I change the url without redirect_to ? When a user hits
> ''cancel'', I want the URL to not include
''/save_requirement'' anymore.
>
> Thanks!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---