I am making a gem https://github.com/BDMADE/college-admin , It is a simple a layout of an admin template, I am making this gem, for why, I want to re-use in my several rails app.
My welcome controller:
class WelcomeController < ApplicationController
@hello = 'Hello Word'
<p>Find me in app/views/welcome/index.html.erb</p>
<%= @hello %>
You need an engine which is a gem with added integration in to the Rails stack.
Engines can be considered miniature applications that provide functionality to their host applications. A Rails application is actually just a "supercharged" engine, with the Rails::Application class inheriting a lot of its behavior from Rails::Engine.
You can create a new engine with:
bundle exec rails plugin new <NAME> --mountable --full --dummy-path=spec/dummy