We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 004314c commit 31b1744Copy full SHA for 31b1744
lib/view_component/base.rb
@@ -316,10 +316,12 @@ def view_cache_dependencies
316
[]
317
end
318
319
- # Rails expects us to define `format` on all renderables,
320
- # but we do not know the `format` of a ViewComponent until runtime.
321
- def format
322
- nil
+ if Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR == 1
+ # Rails expects us to define `format` on all renderables,
+ # but we do not know the `format` of a ViewComponent until runtime.
+ def format
323
+ nil
324
+ end
325
326
327
# The current request. Use sparingly as doing so introduces coupling that
0 commit comments