Comments (10)
This took some serious time to figure out but I got it working.
from madmin.
Spoke too soon! Thought this was related to Zeitwerk itself, but it appears this has to do with the way Rails now auto loads paths.
This is the breaking commit from Rails: rails/rails@2306a8e.
I am not an expert here, but is Rails eager loading the directory before engines are initialized?
from madmin.
@excid3 of course... trying to figure it out myself :-)
from madmin.
I had to dig through the Rails source code to figure it out. Couldn't find any examples or anything. The previous stuff was what I had found in a blog post, but this works consistently across all Rails versions using before_configuration
. I didn't even know that was a callback you could use until I started reading the Rails source.
from madmin.
Telling Rails to collapse the resources directory fixed the issue. I did so by adding the following to config/application.rb
:
Rails.autoloaders.main.collapse('app/madmin/resources')
from madmin.
Is this something that changed specifically in Zeitwerk 2.5?
from madmin.
Could be that the Madmin initializer isn't running early enough now. We do a similar thing to make sure the autoload paths are added before they get frozen.
https://github.com/excid3/madmin/blob/master/lib/madmin/engine.rb#L3
from madmin.
Can confirm... resource loading does not appear to work in Rails 7 alpha
from madmin.
PRs welcome if you figure out what's going on.
from madmin.
@excid3 did you come across something that shows path loading needs to happen 'before configuration' or was that just the hook placement that ended up working?
from madmin.
Related Issues (20)
- Dummy App New User Form Error HOT 2
- Relation fields in forms are not working HOT 2
- Build Error with Skypack HOT 2
- Seeds quietly failing
- Pagination Styling has Disappeared HOT 2
- NoMethodError in Madmin::ActiveStorage::Blobs#index HOT 3
- Madmin sortable helper conflicts with JSP sortable helper HOT 9
- edit user model with devise will cause error HOT 1
- Visit model show page with active storage attachment will raise 500 error
- Relax Pagy dependencies HOT 1
- ActionText seems not to be supported HOT 2
- Is it possible to search attributes of a Resource's assocations? HOT 1
- Madmin breaks application boot when a migration adds a field and a madmin attribute is added before running the migration. HOT 2
- Relationships are unnecessarily preloaded
- forms + typography have stopped resolving HOT 6
- Skypack CDN failing to return Stimulus packages HOT 4
- Selecting associated models HOT 2
- AmbiguousColumn ERROR in `views/madmin/fields/has_many/_form.html.erb`
- Application and route helpers stopped working after upgrading to version 1.2.7 HOT 2
- Madmin errors - Users and notifications HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from madmin.