Created
October 5, 2020 05:15
-
-
Save obie/9ba2e226c33c9d783970c1a2d212c87f to your computer and use it in GitHub Desktop.
Workaround solution for having to restart Rails server to pickup changes to ViewComponent templates (Rails 6.1)
This file contains hidden or 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 | |
after_action :clear_view_component_cache, if: -> { Rails.env.development? } | |
def clear_view_component_cache | |
ViewComponent::CompileCache.cache = Set.new | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment