Skip to content

Instantly share code, notes, and snippets.

@saiqulhaq
Created December 12, 2021 00:42
Show Gist options
  • Save saiqulhaq/b1174cef959dcc11781b1ca74356e92b to your computer and use it in GitHub Desktop.
Save saiqulhaq/b1174cef959dcc11781b1ca74356e92b to your computer and use it in GitHub Desktop.
Ruby on Rails: include view files from gem/plugins
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