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

Rails 5 - ClientSide Strategy - Error delegate :env #19

Open
GesJeremie opened this issue Oct 16, 2019 · 1 comment
Open

Rails 5 - ClientSide Strategy - Error delegate :env #19

GesJeremie opened this issue Oct 16, 2019 · 1 comment

Comments

@GesJeremie
Copy link

GesJeremie commented Oct 16, 2019

Hey :)

Just to let you know I'm really glad you did this gem: I encountered all the problems you mentioned in your README and started to make my own implementation before to find mengpaneel (you solved the problem 100 times better than my current scrappy solution).

Even though it's been a while you didn't update the gem it seems to work just fine. I had a minor bug I wanted to report with the class Mengpaneel::Strategy::ClientSide.

Currently you delegate :env to the controller:

delegate :request, :response, :env, to: :controller, allow_nil: true

I'm currently running on Rails 5.2.0 and it seems :env has been deprecated in favor of request.env.

I added a little shortcut in my ApplicationController to solve the problem:

class ApplicationController < ActionController::Base
  include Mengpaneel::Controller

  def env
    request.env
  end
end

If you find the time to do an update, it would be crazy cool!

Thanks again!

@DouweM
Copy link
Owner

DouweM commented Oct 23, 2019

@GesJeremie I’m pleasantly surprised to hear that this 5-year old gem is still proving useful to people! 😄

Thanks for reporting this bug and describing a potential fix; do you think you could submit a pull request? I’m more than happy to release a new version, but I don’t have time to write and verify a fix myself right now. Thanks in advance!

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