When a gem is mounted, its internal paths are mounted into the regular Rails lookup paths, but importantly, they are not looked at first in the lookup process. You can read the Rails Guide about Layouts and Rendering to learn more about this process:
https://guides.rubyonrails.org/layouts_and_rendering.html#finding-layouts
When a controller in the gem calls "render", explicitly or implicitly, Rails will first look in the app's views directory to find that template or layout or partial. Only if it does not find it there will it look in the gem. I don't think that the vendor directory even comes into play here.
The easiest way to figure this out is to look at the internal layout of the gem on GitHub. Tell us which one you're using, and this can be figured out quite easily. For example, here is a gem that provides views:
https://github.com/rubysherpas/forem
Click into the app/views directory, and you'll see two directories: forem and layouts/forem. These directories are going to be "projected" into the parent Rails app's app/views directory. You won't see them, but Rails will act as though they are there.
If you wanted to override a view provided in either of those directories, say, layouts/forem/default.html.erb, all you would need to do in your app is to create a folder named app/views/forem, and put a file named default.html.erb in it. Whatever you put in that file in your app will be loaded whenever the gem requests the same-named file, and the file that was in the gem itself will be ignored. Rails always loads and uses the first file it finds. This is by design, so an app can override a gem if desired.
Walter
> On Jan 5, 2019, at 8:33 AM, fugee ohu <
fuge...@gmail.com> wrote:
>
> I'm trying to override the main layout but the gem is actually using other gems together as a group so there's a separate gem for vendor Within the vendor gem can be found app/views but within my main app the question is what should the path to overrides be vendor/app/views or app/views/vendor
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/608a4abe-c82e-4681-a8ac-0b7996f6b4b2%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.