Created
December 12, 2021 00:42
-
-
Save saiqulhaq/b1174cef959dcc11781b1ca74356e92b to your computer and use it in GitHub Desktop.
Ruby on Rails: include view files from gem/plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
before_action :prepend_view_paths | |
def prepend_view_paths | |
prepend_view_path "#{Bundler.locked_gems.dependencies['your_gem_name'].source.path}/app/views/" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment