Skip to content

Bundler needs require; should document that in README or change file #3

@jeremywadsack

Description

@jeremywadsack

When I tried to use this gem, I got this error:

NoMethodError:
  undefined method `before_render' for ReportsController:Class
  Did you mean?  before_filter

This is happening because bundler isn't autoloading the gem's files because the file name doesn't match the gem name. I resolved this by changing my gem line as follows:

gem "rails5_before_render", require: "before_render"

A quick solution to this would be to update the README.md with the above change.

Alternately, changing lib/before_render.rb to lib/rails5_before_render would resolve that problem too. That might cause a breaking change (for those who have already required the current file); you could keep lib/before_render.rb and have one of those two files require the other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions