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

undefined method `relative_time' when include_all_helpers is false #550

Closed
shouichi opened this issue Apr 4, 2022 · 4 comments · Fixed by #553
Closed

undefined method `relative_time' when include_all_helpers is false #550

shouichi opened this issue Apr 4, 2022 · 4 comments · Fixed by #553

Comments

@shouichi
Copy link
Contributor

shouichi commented Apr 4, 2022

When include_all_helpers is set to false, only a helper which matches the name of the controller is included.

https://api.rubyonrails.org/classes/ActionController/Helpers.html

GoodJob engine defines some helpers in ApplicationHelper, thus only the ApplicationController (and its children) can access those helpers. Currently, the base controller is named BaseController and those helpers are not available.

Thank you.

@bensheldon
Copy link
Owner

@shouichi thank you for reporting this! There's likely a lot of Rails configuration assumptions being made 😓

I can make a quick fix for this (explicitly requiring the helpers in the BaseController), unless you'd like to make the PR.

@shouichi
Copy link
Contributor Author

shouichi commented Apr 4, 2022

Thanks for the reply!

Sure, we can quickly fix it by explicitly including the helper. I have a small question before making that change. Can we rename BaseController to ApplicationController (which is more common I believe)? That way, we can follow the rails convention.

@bensheldon
Copy link
Owner

Yep, BaseController can be renamed. I don't have much experience with Engine conventions, but change is easy 😊

@shouichi
Copy link
Contributor Author

shouichi commented Apr 5, 2022

Thanks for the feedback. I'll submit a PR!

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

Successfully merging a pull request may close this issue.

2 participants