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

Rendering of blank page after usual ajax head response #12

Closed
omitter opened this issue Feb 26, 2019 · 5 comments
Closed

Rendering of blank page after usual ajax head response #12

omitter opened this issue Feb 26, 2019 · 5 comments

Comments

@omitter
Copy link

omitter commented Feb 26, 2019

When I make a usual ajax call where I'm only interested in the status code I usually use head instead of rendering anything. It looks like turbolinks_render falsely intercepts these calls and substitutes the whole page with a blank string.

example script:

    $.ajax
      url: "/posts/" + post_id + "/like",
      method: 'PUT',
      success: () ->
        $this.toggleClass("clicked")

example controller:

  def like
    if Post.find(params[:post_id]).like!(@user)
      head :ok
    else
      head :forbidden
    end
  end
@jorgemanrubia
Copy link
Owner

Thanks for the report @omitter. I'll see how to fix this.

@jorgemanrubia
Copy link
Owner

Hey @omitter I couldn't reproduce with a quick test. Are you using the last version of the gem 0.9.11? I still need to test more, but I was wondering if you might be using an older version here.

@jorgemanrubia
Copy link
Owner

Nevermind I could reproduce, I'll see how to fix soonish

@jorgemanrubia
Copy link
Owner

I just released version 0.9.12 fixing this. Thanks for the bug report @omitter!

@omitter
Copy link
Author

omitter commented Feb 27, 2019

Great, I can confirm that it works. Thanks!

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

2 participants