Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for turbolinks #91

Closed
glebtv opened this issue Jan 17, 2013 · 14 comments
Closed

Support for turbolinks #91

glebtv opened this issue Jan 17, 2013 · 14 comments

Comments

@glebtv
Copy link

glebtv commented Jan 17, 2013

Currently, when turbolinks gem is used, you see this if you come to a page through turbolinks:
17-01-2013 18-49-53

@rstacruz
Copy link
Collaborator

Surprise, surprise! I was just working with Turbolinks and ran into the same issue. This shouldn't be very difficult.

@rstacruz
Copy link
Collaborator

...I take that back. I thought Turbolinks would have an easy way to opt-out by adding some markup on the target page, but I don't think so.

@rstacruz
Copy link
Collaborator

For now, when you reach that page, just load /__better_errors in a different tab.

@rstacruz
Copy link
Collaborator

There we go, semi-fixed. The silly thing here is that when you press 'back', it will loads the page that threw the error, thus triggering the error again...

That's the most naive fix I can think of right now. If anyone has a better one (hopefully one that doesn't break the back button), reply here or open a new pull request.

@haileys
Copy link
Collaborator

haileys commented Jan 17, 2013

sigh, I'm hardly surprised turbolinks breaks shit like this

On Friday, 18 January 2013 at 6:58 AM, Rico Sta. Cruz wrote:

There we go, semi-fixed. The silly thing here is that when you press 'back', it will loads the page that threw the error, thus triggering the error again...
That's the most naive fix I can think of right now. If anyone has a better one, let me know.


Reply to this email directly or view it on GitHub (#91 (comment)).

@ook
Copy link

ook commented Jan 18, 2013

At better_errors loading, once detecting turbolinks, why not pushing into history a (static) page saying « Hey, that's better error again. The previous page thrown an error, we're not sure you want to go back. But if you insist, click here. »

This way people wanting to relaunch the page after fixing it can do it, and « n00bs » are not frightened by repetition of the same error.

@rstacruz
Copy link
Collaborator

I did something else now: Better Errors loads in place (like Turbolinks), but the scripts/styles are now in body, so the page will look fine. It also clears out the scripts and the styles of the host page, so it should look fine.

This effectively means that once you reach a page, you can just do a Ctrl+R reload from there (I know that's my instinct).

@glebtv
Copy link
Author

glebtv commented Jan 21, 2013

Latest version from git now doesn't work at all - just shows standard rails error page..

@virusman
Copy link
Contributor

Just tried the edge version with latest turbolinks:
The problem with this solution, apparently, is that going back won't change the stylesheets. So the layout of the previous page will blow up because it'll be rendered using better_errors styles.

@virusman
Copy link
Contributor

Actually, when the error page is displayed, head becomes completely empty. When I go back, only title is added, with no stylesheets at all. Tested with turbolinks 0.6.1 and 1.0.0.

@rstacruz
Copy link
Collaborator

Latest version from git now doesn't work at all - just shows standard rails error page..

@glebtv, thanks for the report—can you (or anyone else) confirm that it's fixed now?

@glebtv
Copy link
Author

glebtv commented Jan 25, 2013

I get a standard rails error page.

@rstacruz
Copy link
Collaborator

Works for me at master (5db3b8e)--tried it with a fresh app and an existing app. If you're getting the standard Rails error page, it may be something specific to your setup. Can you see if /__better_errors loads for you after an error is triggered?

I'm guessing better errors isn't loaded at all... say, maybe your env is production, or your Gemfile isn't updated.

@glebtv
Copy link
Author

glebtv commented Jan 25, 2013

Sorry, the problem seems to be commit 2446965, not turbolinks.
I opened a new issue #99 for that.

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

No branches or pull requests

5 participants