Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Problems with server-side rendering after upgrading from classic #14

Open
minimul opened this issue Aug 29, 2016 · 4 comments
Open

Problems with server-side rendering after upgrading from classic #14

minimul opened this issue Aug 29, 2016 · 4 comments

Comments

@minimul
Copy link

minimul commented Aug 29, 2016

I have a Rails 4.2.7.1 app and upgraded Turbolinks only:

gem 'turbolinks', github: 'turbolinks/rails'

P.S. App doesn't use any partial replacement.

I have a jQuery ajax call e.g.

$.get({ url: url, dataType: 'script' })

In my Rails controller I have a:

render :new, turbolinks: true

I see that render has not be modified in this version of lib/turbolinks/redirection.rb as with the classic version.

But even if I replace render :new, turbolinks: true with redirect_to the overridden redirect_to did not kick in and do a Turbolinks.visit().

  1. Are there plans to port over classic's lib/turbolinks/redirection.rb with render support? I have bunch of places where render :***** , turbolinks: true is called.
  2. Is there something I need to add to the $.get({ url: url, dataType: 'script' }) call for the Turbolinks.visit to kick in?
@minimul
Copy link
Author

minimul commented May 9, 2017

Update: When upgrading to Rails 5 what I did in these spots was thus e.g.

old

render :new, turbolinks: true

New Rails 5

visit_location_with_turbolinks(new_account_proforma_url(current_account), "replace")

@minimul minimul closed this as completed May 9, 2017
@minimul
Copy link
Author

minimul commented May 10, 2017

Actually the above "solution" is only for redirects. Need to be able to render form/page in Rails and do a Turbolinks.replace() on the body.

@minimul minimul reopened this May 10, 2017
@minimul
Copy link
Author

minimul commented May 10, 2017

Better solved with: #20

@MrHubble
Copy link

@minimul can this issue be closed in favour of #40 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants