I'm working with the Solidus gem that has its own views, and I want to make a gem that overrides some of its views.
Modifying this in a project or custom app is easy since I just have to write the file with the namespace and the name in my project folders, but, what if I want to gemify my result? In other words, I want to write this in my Gemfile
:
gem 'first_gem'
gem 'my_new_gem'
and expect that app/views/controller/file.html.erb
of first_gem
to be overriden by the one I have in my_new_gem
.
I made a .gem
file with modified views in app/views
but when I install it via gem install my_new_gem.gem
and include it with Bundler in a project, views doesn't change anymore.
I've been stuck for hours with this and actually tried this:
- Load gems in order with
Bundler.require
. - List Solidus gem as a dependency in my gem. My gem is required after the dependency as intended, but doesn't work anyway.
Maybe I'm trying something that even isn't working. Maybe I'm not understanding Rubygems at all or maybe I have to preload files with a lib
script. I'm getting lost where to start or where to find information about this.
I know I can use overrides in Solidus, but I'm changing some layouts and some divs that don't have hooks, so I think this is the only way to go.