-
Notifications
You must be signed in to change notification settings - Fork 13
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
Section 2.1: uninitialized constant ActionText::Engine::ApplicationController #9
Comments
Thanks for letting everyone know! |
There is any alternatives to work around and keep /app dir out? |
I haven't found a way. We'll leave this issue open so that others coming across this can add to the conversation. |
Puma caught this error: uninitialized constant ActionText::Engine::ApplicationController (NameError) |
#<NameError: uninitialized constant ApplicationController::DeviseWhitelist> ... and so on.. |
@djordje21 would you describe a bit more of what's going on in your app? Are you using devise? |
@shageman So, in my application_controller.rb : then I went in my module DeviseWhitelist
end At the moment when I post my comment i had instead of I just change it in before_action . |
Ok. Cool. Sounds like you are unblocked for now. Let me know if you come across any other issues!
…On Wed, Feb 19, 2020 at 11:36 AM, Djordje ***@***.***> wrote:
***@***.***(https://github.com/shageman)
It's my first app and I'm still learning how to fix the bugs and I fixed mine somehow.
Yes, I am using Devise, thanks for fast answer.
So, in my application_controller.rb :
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
include DeviseWhitelist
include SetSource
end
then I went in my
devise_whitelist.rb :
module DeviseWhitelist
extend ActiveSupport::Concern
included do
before_action :configure_permitted_parameters, if: :devise_controller?
end
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
devise_parameter_sanitizer.permit(:account_update, keys: [:name])
end
end
At the moment when I post my comment i had instead of
before_action there was
before_filter
but before_filter didn't work, and that was the error message,
I just change it in before_action .
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#9?email_source=notifications&email_token=AABNTTLDWCP3FY577MB23Q3RDV33TA5CNFSM4IY6OI22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMI6WIY#issuecomment-588376867), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AABNTTM2DBXWMKPQBFHKS43RDV33TANCNFSM4IY6OI2Q).
|
I was able to work around this and the sprockets issues by updating config/application.rb to be
|
@mbjornson interesting idea! I have never seen this but think it should be possible: In the requires that you posted, and only what you know the main app needs. Then in a component and a require to additional stuff at the top of components/your-gem/lib/your-gem.rb Generally this is the way in which you ensure that gems have access to all their external dependencies. |
I'm also working in Rails 6 and got this and the sprockets error, so I've been trying to read as much as possible on engines and I suck at webpack to boot. The app that I'm thinking about using cbra approach is for a product I'm building. So I can't really go back to rails 5... I've been trying to go thru Spree, Devise and RefineryCMS's repos to see how they are approaching these two issues. I'm going to try to use the above approach to see how that works. |
I started working through the book with a new Rails 5 app. No issues what so ever. I wonder how many of these issues are due to changes in Rails 6? |
Rails 6.0.0
rails/rails#35749
app
folder con not be removed entirely doing the book on Rails 6, since Zeitwerk autoloading expectsapp/controllers/application_controller.rb
to be in place.Without this file, error
uninitialized constant ActionText::Engine::ApplicationController
is raised while visiting rootThe text was updated successfully, but these errors were encountered: