I need to redirect from within an action called by an Ajax request

  def create
..
respond_with resource do |format|
 format.js {
.. # test on user locale and changed
        I18n.default_locale =
resource.current_membership.account_type.locale.code.to_sym
         I18n.locale = I18n.default_locale
        session[:return_to]["locale"] = I18n.locale.to_s
 @url = session[:return_to] || root_path
        session[:return_to] = nil
 render :action => "signed_in.js"
}

=============
what should I write in my signed_in.js  to redirect to  @url  ??

I wrote
$(location).attr('href',"<%= @url %>");


but it doesn't seems to tale in account the new locale
debugger :  @url
{"utf8"=>"✓", "authenticity_token"=>"EduXy97cc1YvHGRTqVfgCLT3HKfYfRwxF/
VM7yC4+j4=", "user"=>{"login"=>"john....@me.com",
"password"=>"[FILTERED]"}, "commit"=>"SIGN IN", "action"=>"create",
"controller"=>"users/sessions", "locale"=>"es_ES"}
which is the session[:return_to]


-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to